Skip to content

Commit

Permalink
Enable new set of Go metrics in Kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
tosi3k committed Aug 26, 2022
1 parent 8ccd032 commit ce65b71
Show file tree
Hide file tree
Showing 8 changed files with 485 additions and 4 deletions.
Expand Up @@ -20,6 +20,7 @@ import (
"net/http"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promhttp"

"k8s.io/component-base/metrics"
Expand All @@ -44,10 +45,8 @@ var (
)

func init() {
//nolint:staticcheck // SA1019 - replacement function still calls prometheus.NewProcessCollector().
RawMustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
//nolint:staticcheck // SA1019 - replacement function still calls prometheus.NewGoCollector().
RawMustRegister(prometheus.NewGoCollector())
RawMustRegister(collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}))
RawMustRegister(collectors.NewGoCollector(collectors.WithGoCollectorRuntimeMetrics(collectors.MetricsAll)))
}

// Handler returns an HTTP handler for the DefaultGatherer. It is
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce65b71

Please sign in to comment.