Skip to content

Commit

Permalink
metrics: measure roundtrips in seconds
Browse files Browse the repository at this point in the history
not in milliseconds, which results in histogram buckets under '1' being always empty

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
  • Loading branch information
xcoulon committed Nov 20, 2024
1 parent 258c17c commit 00a1c2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/middleware/promhttp_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func InstrumentRoundTripperDuration(histVec *prometheus.HistogramVec) gin.Handle
"code": strconv.Itoa(c.Writer.Status()),
"method": c.Request.Method,
"path": c.Request.URL.Path,
}).Observe(float64(duration.Milliseconds()))
}).Observe(float64(duration.Seconds()))
}()
c.Next()
}
Expand Down

0 comments on commit 00a1c2d

Please sign in to comment.