diff --git a/pkg/collector/stats/utils.go b/pkg/collector/stats/utils.go index 32959ba53d..1bb9c373a2 100644 --- a/pkg/collector/stats/utils.go +++ b/pkg/collector/stats/utils.go @@ -22,6 +22,7 @@ import ( "os/exec" "regexp" "runtime" + "slices" "strconv" "strings" @@ -92,6 +93,10 @@ func GetProcessFeatureNames(bpfSupportedMetrics bpf.SupportedMetrics) []string { return metrics } +func AvailableBPFMetricsHas(s string) bool { + return slices.Contains(AvailableBPFMetrics, s) +} + func GetNodeName() string { if nodeName := os.Getenv("NODE_NAME"); nodeName != "" { return nodeName