From 80792a70e09a301118e2a8a00f06faaead5494d7 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Mon, 13 May 2024 09:12:27 +0200 Subject: [PATCH] feat: add `go_sync_mutex_wait_total_seconds_total` metric Signed-off-by: Simon Pasquier --- cmd/operator/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/operator/main.go b/cmd/operator/main.go index 80696987a..729426e1a 100644 --- a/cmd/operator/main.go +++ b/cmd/operator/main.go @@ -23,6 +23,7 @@ import ( "net/http/pprof" "os" "os/signal" + "regexp" "syscall" "github.com/go-kit/log" @@ -462,7 +463,12 @@ func run(fs *flag.FlagSet) int { admit.Register(mux) r.MustRegister( - collectors.NewGoCollector(collectors.WithGoCollectorRuntimeMetrics(collectors.MetricsScheduler)), + collectors.NewGoCollector( + collectors.WithGoCollectorRuntimeMetrics( + collectors.MetricsScheduler, + collectors.GoRuntimeMetricsRule{Matcher: regexp.MustCompile(`^/sync/.*`)}, + ), + ), collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}), versioncollector.NewCollector("prometheus_operator"), )