From da221fb001edbf090fdf6c64316472f4acadc87a Mon Sep 17 00:00:00 2001 From: Steve Teuber Date: Fri, 1 Nov 2024 14:18:49 +0100 Subject: [PATCH] Add shard label in collstats metrics --- exporter/collstats_collector.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exporter/collstats_collector.go b/exporter/collstats_collector.go index ae2d7c4d8..65030610f 100644 --- a/exporter/collstats_collector.go +++ b/exporter/collstats_collector.go @@ -138,6 +138,10 @@ func (d *collstatsCollector) collect(ch chan<- prometheus.Metric) { labels["collection"] = collection for _, metrics := range stats { + if shard, ok := metrics["shard"].(string); ok { + labels["shard"] = shard + } + for _, metric := range makeMetrics(prefix, metrics, labels, d.compatibleMode) { ch <- metric }