From dc19ba5c6e9d0df6af100e54525ad5d07031708d Mon Sep 17 00:00:00 2001 From: Rubens Farias Date: Thu, 30 Jan 2025 17:19:26 -0500 Subject: [PATCH] Update handlers to match stats_prometheus.go https://github.com/falcosecurity/falcosidekick/pull/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 --- handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers.go b/handlers.go index 123c96400..5b1a2af50 100644 --- a/handlers.go +++ b/handlers.go @@ -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]) } }