mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-22 14:25:28 +00:00
add tags to api call metrics
This commit is contained in:
parent
d3c9e303ff
commit
8fc0603735
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue