Use prometheus-compatible metric naming

This commit is contained in:
Cody Soyland 2019-06-05 12:55:42 -05:00 committed by Matt Jaffee
parent d3db48a1fd
commit 2de8060f2c
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF

View file

@ -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,