Skip to content

Commit

Permalink
Update handlers to match stats_prometheus.go
Browse files Browse the repository at this point in the history
#1051 updated stats_prometheus.go to replace `.` for `_`, but the code that then adds the labels to every instance did not update it, so instances where CUSTOM_FIELDS is set to use a key with `.`s leads to panics.

Signed-off-by: Rubens Farias <[email protected]>
  • Loading branch information
rubensf authored and poiana committed Jan 31, 2025
1 parent 4a634b0 commit dc19ba5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func newFalcoPayload(payload io.Reader) (types.FalcoPayload, error) {
}
}
for key := range config.Templatedfields {
if regPromLabels.MatchString(key) {
if regPromLabels.MatchString(strings.ReplaceAll(i, ".", "_")) {
promLabels[key] = fmt.Sprintf("%v", falcopayload.OutputFields[key])
}
}
Expand Down

0 comments on commit dc19ba5

Please sign in to comment.