Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9f3dfa

Browse files
committed
added method to requests concurrent
1 parent 3ff76bb commit d9f3dfa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

coderd/httpmw/prometheus.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func Prometheus(register prometheus.Registerer) func(http.Handler) http.Handler
2727
Subsystem: "api",
2828
Name: "concurrent_requests",
2929
Help: "The number of concurrent API requests.",
30-
}, []string{"path"})
30+
}, []string{"method", "path"})
3131
websocketsConcurrent := factory.NewGaugeVec(prometheus.GaugeOpts{
3232
Namespace: "coderd",
3333
Subsystem: "api",
@@ -82,8 +82,8 @@ func Prometheus(register prometheus.Registerer) func(http.Handler) http.Handler
8282

8383
dist = websocketsDist
8484
} else {
85-
requestsConcurrent.WithLabelValues(path).Inc()
86-
defer requestsConcurrent.WithLabelValues(path).Dec()
85+
requestsConcurrent.WithLabelValues(method, path).Inc()
86+
defer requestsConcurrent.WithLabelValues(method, path).Dec()
8787

8888
dist = requestsDist
8989
distOpts = []string{method}

0 commit comments

Comments
 (0)