mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-04 20:06:12 +02:00
Merge pull request #12472 from metalmatze/request-counter-init
web: Initialize requestCounter metrics to 0 with handler and 200 labels
This commit is contained in:
commit
71d149a79f
@ -158,6 +158,7 @@ func (m *metrics) instrumentHandlerWithPrefix(prefix string) func(handlerName st
|
||||
}
|
||||
|
||||
func (m *metrics) instrumentHandler(handlerName string, handler http.HandlerFunc) http.HandlerFunc {
|
||||
m.requestCounter.WithLabelValues(handlerName, "200")
|
||||
return promhttp.InstrumentHandlerCounter(
|
||||
m.requestCounter.MustCurryWith(prometheus.Labels{"handler": handlerName}),
|
||||
promhttp.InstrumentHandlerDuration(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user