Skip to content

Commit

Permalink
metrics: register go and process collectors
Browse files Browse the repository at this point in the history
Signed-off-by: Iceber Gu <caiwei95@hotmail.com>
  • Loading branch information
Iceber committed Aug 28, 2024
1 parent 58b67c8 commit 35058ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package metrics

import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
versionCollector "github.com/prometheus/client_golang/prometheus/collectors/version"
)

Expand All @@ -12,5 +13,9 @@ func DefaultRegistry() prometheus.Registerer {
}

func init() {
registry.MustRegister(versionCollector.NewCollector("clusterpedia_kube_state_metrics"))
registry.MustRegister(
versionCollector.NewCollector("clusterpedia_kube_state_metrics"),
collectors.NewGoCollector(),
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
)
}

0 comments on commit 35058ab

Please sign in to comment.