diff --git a/cmd/rekor-server/app/root.go b/cmd/rekor-server/app/root.go index 0d10b2f38..df8eea269 100644 --- a/cmd/rekor-server/app/root.go +++ b/cmd/rekor-server/app/root.go @@ -76,7 +76,7 @@ func init() { rootCmd.PersistentFlags().String("rekor_server.signer", "memory", `Rekor signer to use. Valid options are: [gcpkms, memory, filename containing PEM encoded private key]. - Memory and file-based signers should only be used for testing.`) +Memory and file-based signers should only be used for testing.`) rootCmd.PersistentFlags().String("rekor_server.signer-passwd", "", "Password to decrypt signer private key") rootCmd.PersistentFlags().Uint16("port", 3000, "Port to bind to") diff --git a/pkg/api/metrics.go b/pkg/api/metrics.go index b22731f1b..36d0d324a 100644 --- a/pkg/api/metrics.go +++ b/pkg/api/metrics.go @@ -20,6 +20,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + "sigs.k8s.io/release-utils/version" ) var ( @@ -51,4 +52,19 @@ var ( Name: "rekor_qps_by_api", Help: "Api QPS by path, method, and response code", }, []string{"path", "method", "code"}) + + _ = promauto.NewGaugeFunc( + prometheus.GaugeOpts{ + Namespace: "rekor", + Name: "build_info", + Help: "A metric with a constant '1' value labeled by version, revision, branch, and goversion from which rekor was built.", + ConstLabels: prometheus.Labels{ + "version": version.GetVersionInfo().GitVersion, + "revision": version.GetVersionInfo().GitCommit, + "build_date": version.GetVersionInfo().BuildDate, + "goversion": version.GetVersionInfo().GoVersion, + }, + }, + func() float64 { return 1 }, + ) )