forked from mirrors/statsd_exporter
Add metric for total number of conflicting events
This commit is contained in:
parent
c1791d7ecb
commit
bbd5227a1c
2 changed files with 11 additions and 0 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue