Return after errors

This commit is contained in:
Cody Soyland 2019-06-07 08:58:15 -05:00
parent edd26407f5
commit 2d6e948c83

View file

@ -177,6 +177,7 @@ func (c *prometheusClient) Gauge(name string, value float64, rate float64) {
gauge, err = gaugeVec.GetMetricWith(labels)
if err != nil {
c.logger.Printf("gaugeVec.GetMetricWith error: %s", err)
return
}
}
gauge.Set(float64(value))
@ -219,6 +220,7 @@ func (c *prometheusClient) Histogram(name string, value float64, rate float64) {
observer, err = summaryVec.GetMetricWith(labels)
if err != nil {
c.logger.Printf("summaryVec.GetMetricWith error: %s", err)
return
}
}
observer.Observe(value)