mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: rename service -> coder_service, remove agent_id label (#19241)
Pyroscope uses `service` tag for top level distinction. So move our `service` -> `coder_service`
This commit is contained in:
+14
-1
@@ -22,9 +22,22 @@ func WithProfilingLabels(next http.Handler) http.Handler {
|
||||
requestType = "websocket"
|
||||
}
|
||||
|
||||
pprof.Do(ctx, pproflabel.Service(pproflabel.ServiceHTTPServer, "request_type", requestType), func(ctx context.Context) {
|
||||
pprof.Do(ctx, pproflabel.Service(pproflabel.ServiceHTTPServer, pproflabel.RequestTypeTag, requestType), func(ctx context.Context) {
|
||||
r = r.WithContext(ctx)
|
||||
next.ServeHTTP(rw, r)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func WithStaticProfilingLabels(labels pprof.LabelSet) func(next http.Handler) http.Handler {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
|
||||
pprof.Do(ctx, labels, func(ctx context.Context) {
|
||||
r = r.WithContext(ctx)
|
||||
next.ServeHTTP(rw, r)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user