Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pkg/rdt/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}