Skip to content

Commit d36372a

Browse files
committed
rdt: correct prometheus metric types
Align with the the OTEL metrics.
1 parent 48c79b5 commit d36372a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

pkg/rdt/prometheus.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,22 @@ func (c *collector) collectGroupMetrics(ch chan<- prometheus.Metric, g ResctrlGr
127127
for feature, value := range data {
128128
ch <- prometheus.MustNewConstMetric(
129129
c.describeL3(feature),
130-
prometheus.CounterValue,
130+
promValueTypeL3(feature),
131131
float64(value),
132132
labels...,
133133
)
134134
}
135135
}
136136
}
137+
138+
// promValueTypeL3 returns Prometheus value type for given L3 metric.
139+
func promValueTypeL3(feature string) prometheus.ValueType {
140+
switch feature {
141+
case "llc_occupancy":
142+
return prometheus.GaugeValue
143+
case "mbm_local_bytes", "mbm_total_bytes":
144+
return prometheus.CounterValue
145+
default:
146+
return prometheus.GaugeValue
147+
}
148+
}

0 commit comments

Comments
 (0)