Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1798315: Console operator should provide valid gitCommit and gitVersion versions #377

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/console/version/version.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package version

import (
"github.com/prometheus/client_golang/prometheus"

"k8s.io/apimachinery/pkg/version"
"k8s.io/component-base/metrics"
"k8s.io/component-base/metrics/legacyregistry"
)

var (
Expand Down Expand Up @@ -34,14 +34,14 @@ func Get() version.Info {
}

func init() {
buildInfo := prometheus.NewGaugeVec(
prometheus.GaugeOpts{
buildInfo := metrics.NewGaugeVec(
&metrics.GaugeOpts{
Name: "openshift_console_operator_build_info",
Help: "A metric with a constant '1' value labeled by major, minor, git commit & git version from which OpenShift Console Operator was built.",
},
[]string{"major", "minor", "gitCommit", "gitVersion"},
)
buildInfo.WithLabelValues(majorFromGit, minorFromGit, commitFromGit, versionFromGit).Set(1)

prometheus.MustRegister(buildInfo)
legacyregistry.MustRegister(buildInfo)
}