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 <mail@olegzaytsev.com>
This commit is contained in:
Oleg Zaytsev 2024-11-05 15:09:23 +01:00
parent 02aa6d1de6
commit 50e83e8f98

View file

@ -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$`)},
),
),
)