mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-11-26 01:01:01 +00:00
change metric labels to observer
Signed-off-by: glightfoot <glightfoot@rsglab.com>
This commit is contained in:
parent
374d202daa
commit
d95a53553e
1 changed files with 5 additions and 5 deletions
|
@ -154,24 +154,24 @@ func (b *Exporter) handleEvent(thisEvent event.Event) {
|
||||||
histogram, err := b.Registry.GetHistogram(metricName, prometheusLabels, help, mapping, b.MetricsCount)
|
histogram, err := b.Registry.GetHistogram(metricName, prometheusLabels, help, mapping, b.MetricsCount)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
histogram.Observe(thisEvent.Value())
|
histogram.Observe(thisEvent.Value())
|
||||||
b.EventStats.WithLabelValues("timer").Inc()
|
b.EventStats.WithLabelValues("observer").Inc()
|
||||||
} else {
|
} else {
|
||||||
level.Debug(b.Logger).Log("msg", regErrF, "metric", metricName, "error", err)
|
level.Debug(b.Logger).Log("msg", regErrF, "metric", metricName, "error", err)
|
||||||
b.ConflictingEventStats.WithLabelValues("timer").Inc()
|
b.ConflictingEventStats.WithLabelValues("observer").Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
case mapper.TimerTypeDefault, mapper.TimerTypeSummary:
|
case mapper.TimerTypeDefault, mapper.TimerTypeSummary:
|
||||||
summary, err := b.Registry.GetSummary(metricName, prometheusLabels, help, mapping, b.MetricsCount)
|
summary, err := b.Registry.GetSummary(metricName, prometheusLabels, help, mapping, b.MetricsCount)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
summary.Observe(thisEvent.Value())
|
summary.Observe(thisEvent.Value())
|
||||||
b.EventStats.WithLabelValues("timer").Inc()
|
b.EventStats.WithLabelValues("observer").Inc()
|
||||||
} else {
|
} else {
|
||||||
level.Debug(b.Logger).Log("msg", regErrF, "metric", metricName, "error", err)
|
level.Debug(b.Logger).Log("msg", regErrF, "metric", metricName, "error", err)
|
||||||
b.ConflictingEventStats.WithLabelValues("timer").Inc()
|
b.ConflictingEventStats.WithLabelValues("observer").Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
level.Error(b.Logger).Log("msg", "unknown timer type", "type", t)
|
level.Error(b.Logger).Log("msg", "unknown observer type", "type", t)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue