mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2025-02-14 14:45:15 +00:00
Keep track of metric names on the metric statsd_exporter_events_conflict_total
Signed-off-by: Pedro Tanaka <pedro.tanaka@shopify.com>
This commit is contained in:
parent
32fee3f94b
commit
d45b0e3e36
3 changed files with 6 additions and 6 deletions
2
main.go
2
main.go
|
@ -148,7 +148,7 @@ var (
|
||||||
Name: "statsd_exporter_events_conflict_total",
|
Name: "statsd_exporter_events_conflict_total",
|
||||||
Help: "The total number of StatsD events with conflicting names.",
|
Help: "The total number of StatsD events with conflicting names.",
|
||||||
},
|
},
|
||||||
[]string{"type"},
|
[]string{"type", "metric_name"},
|
||||||
)
|
)
|
||||||
errorEventStats = promauto.NewCounterVec(
|
errorEventStats = promauto.NewCounterVec(
|
||||||
prometheus.CounterOpts{
|
prometheus.CounterOpts{
|
||||||
|
|
|
@ -137,7 +137,7 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
|
||||||
b.EventStats.WithLabelValues("counter").Inc()
|
b.EventStats.WithLabelValues("counter").Inc()
|
||||||
} else {
|
} else {
|
||||||
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
|
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
|
||||||
b.ConflictingEventStats.WithLabelValues("counter").Inc()
|
b.ConflictingEventStats.WithLabelValues("counter", metricName).Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
case *event.GaugeEvent:
|
case *event.GaugeEvent:
|
||||||
|
@ -152,7 +152,7 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
|
||||||
b.EventStats.WithLabelValues("gauge").Inc()
|
b.EventStats.WithLabelValues("gauge").Inc()
|
||||||
} else {
|
} else {
|
||||||
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
|
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
|
||||||
b.ConflictingEventStats.WithLabelValues("gauge").Inc()
|
b.ConflictingEventStats.WithLabelValues("gauge", metricName).Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
case *event.ObserverEvent:
|
case *event.ObserverEvent:
|
||||||
|
@ -172,7 +172,7 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
|
||||||
b.EventStats.WithLabelValues("observer").Inc()
|
b.EventStats.WithLabelValues("observer").Inc()
|
||||||
} else {
|
} else {
|
||||||
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
|
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
|
||||||
b.ConflictingEventStats.WithLabelValues("observer").Inc()
|
b.ConflictingEventStats.WithLabelValues("observer", metricName).Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
case mapper.ObserverTypeDefault, mapper.ObserverTypeSummary:
|
case mapper.ObserverTypeDefault, mapper.ObserverTypeSummary:
|
||||||
|
@ -182,7 +182,7 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
|
||||||
b.EventStats.WithLabelValues("observer").Inc()
|
b.EventStats.WithLabelValues("observer").Inc()
|
||||||
} else {
|
} else {
|
||||||
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
|
b.Logger.Debug(regErrF, "metric", metricName, "error", err)
|
||||||
b.ConflictingEventStats.WithLabelValues("observer").Inc()
|
b.ConflictingEventStats.WithLabelValues("observer", metricName).Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -117,7 +117,7 @@ var (
|
||||||
Name: "statsd_exporter_events_conflict_total",
|
Name: "statsd_exporter_events_conflict_total",
|
||||||
Help: "The total number of StatsD events with conflicting names.",
|
Help: "The total number of StatsD events with conflicting names.",
|
||||||
},
|
},
|
||||||
[]string{"type"},
|
[]string{"type", "metric_name"},
|
||||||
)
|
)
|
||||||
errorEventStats = prometheus.NewCounterVec(
|
errorEventStats = prometheus.NewCounterVec(
|
||||||
prometheus.CounterOpts{
|
prometheus.CounterOpts{
|
||||||
|
|
Loading…
Reference in a new issue