Merge pull request #605 from pedro-stanaka/feat/clash-metric-name-label

Keep track of metric names on the metric statsd_exporter_events_conflict_total
This commit is contained in:
Pedro Tanaka 2025-01-24 10:15:12 +01:00 committed by GitHub
commit a7bc1e8652
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -148,7 +148,7 @@ var (
Name: "statsd_exporter_events_conflict_total",
Help: "The total number of StatsD events with conflicting names.",
},
[]string{"type"},
[]string{"type", "metric_name"},
)
errorEventStats = promauto.NewCounterVec(
prometheus.CounterOpts{

View file

@ -137,7 +137,7 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
b.EventStats.WithLabelValues("counter").Inc()
} else {
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
b.ConflictingEventStats.WithLabelValues("counter").Inc()
b.ConflictingEventStats.WithLabelValues("counter", metricName).Inc()
}
case *event.GaugeEvent:
@ -152,7 +152,7 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
b.EventStats.WithLabelValues("gauge").Inc()
} else {
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
b.ConflictingEventStats.WithLabelValues("gauge").Inc()
b.ConflictingEventStats.WithLabelValues("gauge", metricName).Inc()
}
case *event.ObserverEvent:
@ -172,7 +172,7 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
b.EventStats.WithLabelValues("observer").Inc()
} else {
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
b.ConflictingEventStats.WithLabelValues("observer").Inc()
b.ConflictingEventStats.WithLabelValues("observer", metricName).Inc()
}
case mapper.ObserverTypeDefault, mapper.ObserverTypeSummary:
@ -182,7 +182,7 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
b.EventStats.WithLabelValues("observer").Inc()
} else {
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
b.ConflictingEventStats.WithLabelValues("observer").Inc()
b.ConflictingEventStats.WithLabelValues("observer", metricName).Inc()
}
default:

View file

@ -117,7 +117,7 @@ var (
Name: "statsd_exporter_events_conflict_total",
Help: "The total number of StatsD events with conflicting names.",
},
[]string{"type"},
[]string{"type", "metric_name"},
)
errorEventStats = prometheus.NewCounterVec(
prometheus.CounterOpts{