Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions deploy/05-metrics_service.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ limitations under the License.
package main

import (
"context"
"flag"
"os"

"github.com/openshift/configure-goalert-operator/config"
"github.com/openshift/configure-goalert-operator/pkg/localmetrics"
"github.com/openshift/operator-custom-metrics/pkg/metrics"
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
Expand Down Expand Up @@ -55,10 +57,8 @@ func init() {
}

func main() {
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
"Enable leader election for controller manager. "+
Expand All @@ -73,7 +73,7 @@ func main() {

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
MetricsBindAddress: "0",
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
Expand Down Expand Up @@ -120,7 +120,7 @@ func main() {
WithRoute().
GetConfig()

if err = metrics.ConfigureMetrics(ctrl.SetupSignalHandler(), *metricsServer); err != nil {
if err = metrics.ConfigureMetrics(context.TODO(), *metricsServer); err != nil {
setupLog.Error(err, "failed to configure custom metrics")
os.Exit(1)
}
Expand Down