Skip to content

Commit 60d55fd

Browse files
tamareyaltamareyal
andauthored
Fix --const-label option (#113)
Signed-off-by: tamareyal <tamareyal@gmail.com> Co-authored-by: tamareyal <tamareyal@gmail.com>
1 parent 10abc54 commit 60d55fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

metrics/serve.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,12 @@ func (c *Collector) Run() error {
514514
labelValues = append(labelValues, split[1])
515515
}
516516

517-
mutableState := &metricState{seriesCount: c.cfg.SeriesCount}
517+
mutableState := &metricState{seriesCount: c.cfg.SeriesCount, labelValues: labelValues}
518518
// unsafe means you need to lock c.mu to use it.
519519
unsafeReadOnlyGetState := func() metricState { return *mutableState }
520520

521521
c.mu.Lock() // Just to make race detector happy, not really needed in practice.
522+
c.labelKeys = labelKeys
522523
c.gauges = make([]*prometheus.GaugeVec, c.cfg.GaugeMetricCount)
523524
c.counters = make([]*prometheus.CounterVec, c.cfg.CounterMetricCount)
524525
c.histograms = make([]*prometheus.HistogramVec, c.cfg.HistogramMetricCount)

0 commit comments

Comments
 (0)