use milliseconds in prometheus observation

This commit is contained in:
Shawn Smith
2021-04-24 21:30:55 +09:00
parent d5215bfbc0
commit f23cfcea71

View File

@@ -92,7 +92,7 @@ func setupMetrics() *metrics {
// recordDuration records the length of a request from start to now
func (m metrics) recordDuration(start time.Time, name string) {
elapsed := time.Since(start)
m.responseTimes.WithLabelValues(name).Observe(float64(elapsed.Nanoseconds()))
m.responseTimes.WithLabelValues(name).Observe(float64(elapsed.Milliseconds()))
log.Printf("Served %s in %s", name, elapsed)
}