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 <rubens.mbfarias@gmail.com>
  • Loading branch information
rubensf authored Jan 30, 2025
1 parent 4a634b0 commit 527051b
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, ".", "_")) {

Check failure on line 190 in handlers.go

View workflow job for this annotation

GitHub Actions / lint

undefined: i (typecheck)
promLabels[key] = fmt.Sprintf("%v", falcopayload.OutputFields[key])
}
}
Expand Down

0 comments on commit 527051b

Please sign in to comment.