Skip to content

Commit 7f93308

Browse files
committed
Call rhobs.SetInfo at startup to emit operator info metric
1 parent f8ed228 commit 7f93308

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ import (
4949
"github.com/openshift/route-monitor-operator/controllers/clusterurlmonitor"
5050
"github.com/openshift/route-monitor-operator/controllers/hostedcontrolplane"
5151
"github.com/openshift/route-monitor-operator/controllers/routemonitor"
52+
"github.com/openshift/route-monitor-operator/pkg/rhobs"
5253
rhobsv1 "github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring/v1"
5354
// +kubebuilder:scaffold:imports
5455
)
5556

57+
// version is set at build time via -ldflags
58+
var version = "unknown"
59+
5660
var (
5761
scheme = runtime.NewScheme()
5862
setupLog = ctrl.Log.WithName("setup")
@@ -294,6 +298,7 @@ func main() {
294298
os.Exit(1)
295299
}
296300

301+
rhobs.SetInfo(version)
297302
setupLog.V(2).Info("starting manager")
298303
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
299304
setupLog.Error(err, "problem running manager")

0 commit comments

Comments
 (0)