diff --git a/pkg/rdt/prometheus.go b/pkg/rdt/prometheus.go index 8a74ef4..8300bf5 100644 --- a/pkg/rdt/prometheus.go +++ b/pkg/rdt/prometheus.go @@ -127,10 +127,22 @@ func (c *collector) collectGroupMetrics(ch chan<- prometheus.Metric, g ResctrlGr for feature, value := range data { ch <- prometheus.MustNewConstMetric( c.describeL3(feature), - prometheus.CounterValue, + promValueTypeL3(feature), float64(value), labels..., ) } } } + +// promValueTypeL3 returns Prometheus value type for given L3 metric. +func promValueTypeL3(feature string) prometheus.ValueType { + switch feature { + case "llc_occupancy": + return prometheus.GaugeValue + case "mbm_local_bytes", "mbm_total_bytes": + return prometheus.CounterValue + default: + return prometheus.GaugeValue + } +}