From f23cfcea71e83f56a3eef365fa9885ddc04faace Mon Sep 17 00:00:00 2001 From: Shawn Smith Date: Sat, 24 Apr 2021 21:30:55 +0900 Subject: [PATCH] use milliseconds in prometheus observation --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index ccc2456..bc1ed90 100644 --- a/main.go +++ b/main.go @@ -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) }