diff --git a/main.go b/main.go index daa07c03..c09243b5 100644 --- a/main.go +++ b/main.go @@ -416,15 +416,15 @@ func setupTelemetryServices(opts telemetryOptions) { } func setupManager(options ctrl.Options) (ctrl.Manager, error) { + if options.Metrics.BindAddress != "0" { + options.Metrics.ExtraHandlers = map[string]http.Handler{"/server-metrics": promhttp.Handler()} + } + mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), options) if err != nil { return nil, err } - if options.Metrics.BindAddress != "0" { - options.Metrics.ExtraHandlers = map[string]http.Handler{"/server-metrics": promhttp.Handler()} - } - if options.HealthProbeBindAddress != "0" { if err := mgr.AddHealthzCheck("ping", healthz.Ping); err != nil { return nil, err