add tags to api call metrics

This commit is contained in:
Andre Medeiros 2022-06-28 10:55:52 -04:00
parent d3c9e303ff
commit 8fc0603735

View file

@ -197,8 +197,8 @@ func (a *api) loggingMiddleware(next http.Handler) http.Handler {
}
tags := []string{fmt.Sprintf("status:%d", lrw.statusCode)}
_ = a.statsd.Histogram("api.latency", float64(duration), tags, 0.1)
_ = a.statsd.Incr("api.calls", nil, 0.1)
_ = a.statsd.Histogram("api.latency", float64(duration), nil, 0.1)
_ = a.statsd.Incr("api.calls", tags, 0.1)
if lrw.statusCode >= 500 {
_ = a.statsd.Incr("api.errors", nil, 0.1)
}