github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/pkg/runtime/metrics.go (about) 1 package runtime 2 3 import ( 4 "github.com/prometheus/client_golang/prometheus" 5 "github.com/prometheus/client_golang/prometheus/collectors" 6 ) 7 8 // prometheus client_golang by default registers a collector that collects all metrics, except scheduler metrics 9 // this package unregisters the default collector and adds one that includes scheduler metrics 10 // 11 // in order to register this, the package must be imported anonymously 12 func init() { 13 prometheus.DefaultRegisterer.Unregister(collectors.NewGoCollector()) 14 prometheus.MustRegister(collectors.NewGoCollector( 15 collectors.WithGoCollectorRuntimeMetrics(collectors.MetricsAll), 16 )) 17 }