mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-14 03:11:58 +00:00
Use updated ttl value from mapping in saveLabelValues
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
This commit is contained in:
parent
d1b2dd47a8
commit
e550f061f6
1 changed files with 3 additions and 1 deletions
|
@ -457,7 +457,7 @@ func (b *Exporter) removeStaleMetrics() {
|
|||
}
|
||||
}
|
||||
|
||||
// saveLabelValues stores label values set to labelValues and update lastRegisteredAt time
|
||||
// saveLabelValues stores label values set to labelValues and update lastRegisteredAt time and ttl value
|
||||
func (b *Exporter) saveLabelValues(metricName string, labels prometheus.Labels, ttl time.Duration) {
|
||||
_, hasMetric := b.labelValues[metricName]
|
||||
if !hasMetric {
|
||||
|
@ -473,6 +473,8 @@ func (b *Exporter) saveLabelValues(metricName string, labels prometheus.Labels,
|
|||
}
|
||||
now := time.Now()
|
||||
b.labelValues[metricName][hash].lastRegisteredAt = now
|
||||
// Update ttl from mapping
|
||||
b.labelValues[metricName][hash].ttl = ttl
|
||||
}
|
||||
|
||||
func NewExporter(mapper *mapper.MetricMapper) *Exporter {
|
||||
|
|
Loading…
Reference in a new issue