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:
Steven Masley
2025-08-07 13:58:39 -05:00
committed by GitHub
parent b8851f03e3
commit 34c46c0748
4 changed files with 40 additions and 14 deletions
+14 -1
View File
@@ -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)
})
})
}
}