From 50e83e8f98c49b41ca00a13db2b63f8a17446d2a Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Tue, 5 Nov 2024 15:09:23 +0100 Subject: [PATCH] Export 'go_sync_mutex_wait_total_seconds_total' metric This metric can be useful to debug mutex contention. Ref: https://github.com/golang/go/issues/49881 Signed-off-by: Oleg Zaytsev --- cmd/prometheus/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 8fb6d4d38..fcbc41988 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -27,6 +27,7 @@ import ( "os" "os/signal" "path/filepath" + goregexp "regexp" //nolint:depguard // The Prometheus client library requires us to pass a regexp from this package. "runtime" "runtime/debug" "strconv" @@ -301,6 +302,7 @@ func main() { collectors.WithGoCollectorRuntimeMetrics( collectors.MetricsGC, collectors.MetricsScheduler, + collectors.GoRuntimeMetricsRule{Matcher: goregexp.MustCompile(`^/sync/mutex/wait/total:seconds$`)}, ), ), )