Browse Source

Merge pull request #14148 from prometheus/superq/more_go_metrics

Enable additional Go metrics
pull/14112/head
Ben Kochie 6 months ago committed by GitHub
parent
commit
a6316a5dcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      cmd/prometheus/main.go

13
cmd/prometheus/main.go

@ -42,6 +42,7 @@ import (
"github.com/mwitkow/go-conntrack"
"github.com/oklog/run"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
versioncollector "github.com/prometheus/client_golang/prometheus/collectors/version"
"github.com/prometheus/common/model"
"github.com/prometheus/common/promlog"
@ -252,6 +253,18 @@ func main() {
newFlagRetentionDuration model.Duration
)
// Unregister the default GoCollector, and reregister with our defaults.
if prometheus.Unregister(collectors.NewGoCollector()) {
prometheus.MustRegister(
collectors.NewGoCollector(
collectors.WithGoCollectorRuntimeMetrics(
collectors.MetricsGC,
collectors.MetricsScheduler,
),
),
)
}
cfg := flagConfig{
notifier: notifier.Options{
Registerer: prometheus.DefaultRegisterer,

Loading…
Cancel
Save