From 2de8060f2ca3358aec25785d0e9a925493afcbbf Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Wed, 5 Jun 2019 12:55:42 -0500 Subject: [PATCH] Use prometheus-compatible metric naming --- prometheus/prometheus.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prometheus/prometheus.go b/prometheus/prometheus.go index f4f89f5ba..f75f12489 100644 --- a/prometheus/prometheus.go +++ b/prometheus/prometheus.go @@ -100,6 +100,7 @@ func (c *prometheusClient) Count(name string, value int64, rate float64) { var counter prometheus.Counter var ok bool + name = strings.Replace(name, ".", "_", -1) labels := c.labels() opts := prometheus.CounterOpts{ Namespace: namespace, @@ -148,6 +149,7 @@ func (c *prometheusClient) Gauge(name string, value float64, rate float64) { var gauge prometheus.Gauge var ok bool + name = strings.Replace(name, ".", "_", -1) labels := c.labels() opts := prometheus.GaugeOpts{ Namespace: namespace, @@ -187,6 +189,7 @@ func (c *prometheusClient) Histogram(name string, value float64, rate float64) { var observer prometheus.Observer var ok bool + name = strings.Replace(name, ".", "_", -1) labels := c.labels() opts := prometheus.SummaryOpts{ Namespace: namespace,