diff --git a/exporter.go b/exporter.go index 0a963d2..0603dc7 100644 --- a/exporter.go +++ b/exporter.go @@ -250,6 +250,7 @@ func (b *Exporter) Listen(e <-chan Events) { eventStats.WithLabelValues("counter").Inc() } else { log.Errorf(regErrF, metricName, err) + conflictingEventStats.WithLabelValues("counter").Inc() } case *GaugeEvent: @@ -268,6 +269,7 @@ func (b *Exporter) Listen(e <-chan Events) { eventStats.WithLabelValues("gauge").Inc() } else { log.Errorf(regErrF, metricName, err) + conflictingEventStats.WithLabelValues("gauge").Inc() } case *TimerEvent: @@ -281,6 +283,7 @@ func (b *Exporter) Listen(e <-chan Events) { eventStats.WithLabelValues("timer").Inc() } else { log.Errorf(regErrF, metricName, err) + conflictingEventStats.WithLabelValues("timer").Inc() } default: diff --git a/telemetry.go b/telemetry.go index c668c7d..ae07fcf 100644 --- a/telemetry.go +++ b/telemetry.go @@ -47,6 +47,13 @@ var ( Name: "statsd_exporter_loaded_mappings", Help: "The current number of configured metric mappings.", }) + conflictingEventStats = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "statsd_exporter_events_conflict_total", + Help: "The total number of StatsD events with conflicting names.", + }, + []string{"type"}, + ) ) func init() { @@ -54,4 +61,5 @@ func init() { prometheus.MustRegister(networkStats) prometheus.MustRegister(configLoads) prometheus.MustRegister(mappingsCount) + prometheus.MustRegister(conflictingEventStats) }