Skip to content

Commit

Permalink
improve the name of the prometheus metrics to follow the best practic…
Browse files Browse the repository at this point in the history
…e and the naming convention chosen by Falco

Signed-off-by: Thomas Labarussias <[email protected]>
  • Loading branch information
Issif committed Sep 12, 2024
1 parent 1625dad commit dcaa362
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stats_prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/falcosecurity/falcosidekick/types"
)

const metricPrefix string = "falcosecurity_falcosidekick_"

func getInitPromStats(config *types.Configuration) *types.PromStatistics {
promStats = &types.PromStatistics{
Falco: getFalcoNewCounterVec(config),
Expand All @@ -25,7 +27,7 @@ func getInitPromStats(config *types.Configuration) *types.PromStatistics {
func getInputNewCounterVec() *prometheus.CounterVec {
return promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "falcosidekick_inputs",
Name: metricPrefix + "inputs_total",
},
[]string{"source", "status"},
)
Expand All @@ -34,7 +36,7 @@ func getInputNewCounterVec() *prometheus.CounterVec {
func getOutputNewCounterVec() *prometheus.CounterVec {
return promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "falcosidekick_outputs",
Name: metricPrefix + "outputs_total",
},
[]string{"destination", "status"},
)
Expand Down Expand Up @@ -66,7 +68,7 @@ func getFalcoNewCounterVec(config *types.Configuration) *prometheus.CounterVec {
}
return promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "falco_events",
Name: metricPrefix + "falco_events_total",
},
labelnames,
)
Expand Down

0 comments on commit dcaa362

Please sign in to comment.