-
Notifications
You must be signed in to change notification settings - Fork 243
Open
Labels
enhancementhelp wantedPRs for this issue are especially welcomePRs for this issue are especially welcome
Description
I was using
Lines 167 to 173 in 58769c7
| metricsCount = promauto.NewGaugeVec( | |
| prometheus.GaugeOpts{ | |
| Name: "statsd_exporter_metrics_total", | |
| Help: "The total number of metrics.", | |
| }, | |
| []string{"type"}, | |
| ) |
Then I noticed, across all the reference of the metrics, these's no place to decrease the gauge.
even in the
statsd_exporter/pkg/registry/registry.go
Lines 381 to 396 in 58769c7
| func (r *Registry) RemoveStaleMetrics() { | |
| now := clock.Now() | |
| // delete timeseries with expired ttl | |
| for _, metric := range r.Metrics { | |
| for hash, rm := range metric.Metrics { | |
| if rm.TTL == 0 { | |
| continue | |
| } | |
| if rm.LastRegisteredAt.Add(rm.TTL).Before(now) { | |
| metric.Vectors[rm.VecKey].Holder.Delete(rm.Labels) | |
| metric.Vectors[rm.VecKey].RefCount-- | |
| delete(metric.Metrics, hash) | |
| } | |
| } | |
| } | |
| } |
So I think if we add a decrease in this function, the metric number would show the real number of metric number
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementhelp wantedPRs for this issue are especially welcomePRs for this issue are especially welcome