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

export rekor build/version information #1074

Merged
merged 1 commit into from Sep 24, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/rekor-server/app/root.go
Expand Up @@ -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")
Expand Down
16 changes: 16 additions & 0 deletions pkg/api/metrics.go
Expand Up @@ -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 (
Expand Down Expand Up @@ -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 },
)
)