Skip to content

Commit

Permalink
fix panic in prometheus when hostname field is missing
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Labarussias <[email protected]>
  • Loading branch information
Issif committed Sep 11, 2023
1 parent 19e864f commit b41a6c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ func newFalcoPayload(payload io.Reader) (types.FalcoPayload, error) {
promLabels := map[string]string{"rule": falcopayload.Rule, "priority": falcopayload.Priority.String(), "k8s_ns_name": kn, "k8s_pod_name": kp}
if falcopayload.Hostname != "" {
promLabels["hostname"] = falcopayload.Hostname
} else {
promLabels["hostname"] = "unknown"
}

for key, value := range config.Customfields {
Expand Down

0 comments on commit b41a6c6

Please sign in to comment.