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()
|
eventStats.WithLabelValues("counter").Inc()
|
||||||
} else {
|
} else {
|
||||||
log.Errorf(regErrF, metricName, err)
|
log.Errorf(regErrF, metricName, err)
|
||||||
|
conflictingEventStats.WithLabelValues("counter").Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
case *GaugeEvent:
|
case *GaugeEvent:
|
||||||
|
@ -268,6 +269,7 @@ func (b *Exporter) Listen(e <-chan Events) {
|
||||||
eventStats.WithLabelValues("gauge").Inc()
|
eventStats.WithLabelValues("gauge").Inc()
|
||||||
} else {
|
} else {
|
||||||
log.Errorf(regErrF, metricName, err)
|
log.Errorf(regErrF, metricName, err)
|
||||||
|
conflictingEventStats.WithLabelValues("gauge").Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
case *TimerEvent:
|
case *TimerEvent:
|
||||||
|
@ -281,6 +283,7 @@ func (b *Exporter) Listen(e <-chan Events) {
|
||||||
eventStats.WithLabelValues("timer").Inc()
|
eventStats.WithLabelValues("timer").Inc()
|
||||||
} else {
|
} else {
|
||||||
log.Errorf(regErrF, metricName, err)
|
log.Errorf(regErrF, metricName, err)
|
||||||
|
conflictingEventStats.WithLabelValues("timer").Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -47,6 +47,13 @@ var (
|
||||||
Name: "statsd_exporter_loaded_mappings",
|
Name: "statsd_exporter_loaded_mappings",
|
||||||
Help: "The current number of configured metric 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() {
|
func init() {
|
||||||
|
@ -54,4 +61,5 @@ func init() {
|
||||||
prometheus.MustRegister(networkStats)
|
prometheus.MustRegister(networkStats)
|
||||||
prometheus.MustRegister(configLoads)
|
prometheus.MustRegister(configLoads)
|
||||||
prometheus.MustRegister(mappingsCount)
|
prometheus.MustRegister(mappingsCount)
|
||||||
|
prometheus.MustRegister(conflictingEventStats)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue