Browse Source

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>
pull/15339/head
Oleg Zaytsev 2 weeks ago
parent
commit
50e83e8f98
  1. 2
      cmd/prometheus/main.go

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

Loading…
Cancel
Save