Skip to content

Commit

Permalink
Disable metrics following changes in controller-runtime (#1830)
Browse files Browse the repository at this point in the history
Controller-runtime metrics are now enabled by default since
kubernetes-sigs/controller-runtime#510 was
merged.
To disable metrics, we must explicitly set the port to "0".
  • Loading branch information
sebgl committed Oct 1, 2019
1 parent 5275cf8 commit fdcfd3f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ func execute() {
if metricsPort != 0 {
log.Info("Exposing Prometheus metrics on /metrics", "port", metricsPort)
opts.MetricsBindAddress = fmt.Sprintf(":%d", metricsPort)
} else {
// disable metrics
opts.MetricsBindAddress = "0"
}

mgr, err := ctrl.NewManager(cfg, opts)
Expand Down

0 comments on commit fdcfd3f

Please sign in to comment.