Skip to content

Commit 96e2b22

Browse files
Initialize the most likely HTTP status codes.
1 parent 16f7321 commit 96e2b22

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/webhook/server.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ func instrumentedHook(path string, hookRaw http.Handler) http.Handler {
130130
cnt := metrics.RequestTotal.MustCurryWith(lbl)
131131
gge := metrics.RequestInFlight.With(lbl)
132132

133+
// Initialize the most likely HTTP status codes.
134+
lat.WithLabelValues("200")
135+
lat.WithLabelValues("500")
136+
cnt.WithLabelValues("200")
137+
cnt.WithLabelValues("500")
138+
133139
return promhttp.InstrumentHandlerDuration(
134140
lat,
135141
promhttp.InstrumentHandlerCounter(

0 commit comments

Comments
 (0)