track http status codes in metrics

This commit is contained in:
sm
2018-01-26 18:07:20 -08:00
parent cf10974419
commit 5997dc44d8
4 changed files with 24 additions and 2 deletions
+4
View File
@@ -7,3 +7,7 @@ import (
func HTTPLatency(path string, dur time.Duration) {
httpReqLat.WithLabelValues(path).Observe(float64(dur) / float64(time.Millisecond))
}
func HTTPCode(path string, status string) {
httpStatus.WithLabelValues(path, status).Inc()
}