Skip to content

feat(metrics): expose velero_build_info gauge#9934

Open
amarkdotdev wants to merge 3 commits into
velero-io:mainfrom
amarkdotdev:feat/build-info-metric
Open

feat(metrics): expose velero_build_info gauge#9934
amarkdotdev wants to merge 3 commits into
velero-io:mainfrom
amarkdotdev:feat/build-info-metric

Conversation

@amarkdotdev

@amarkdotdev amarkdotdev commented Jun 23, 2026

Copy link
Copy Markdown

Summary

Fixes #2128.

Registers velero_build_info at server startup with labels for version, git commit, tree state, and Go runtime details.

Testing

  • go test ./pkg/metrics/...

Register a velero_build_info Prometheus metric labeled with version,
git commit, tree state, and Go runtime details at server startup.

Fixes velero-io#2128.

Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

👷 Deploy request for velero pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 0a86c69

The build-info metric needs Go's standard `runtime` package, but
pkg/cmd/server/server.go already imports `k8s.io/apimachinery/pkg/runtime`
under the same name, which broke the build (`runtime` redeclared,
`runtime.NewScheme` undefined). Alias the standard library import as
`goruntime` and use it for the build-info values, leaving the apimachinery
`runtime` untouched.

Also add the required changelog entry for this PR.

Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/cmd/server/server.go 0.00% 5 Missing ⚠️
pkg/metrics/metrics.go 72.72% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

ywk253100
ywk253100 previously approved these changes Jun 29, 2026
Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
@amarkdotdev

Copy link
Copy Markdown
Author

@ywk253100 Thanks for the review and approval.

Pushed 0a86c69 with a RegisterBuildInfo unit test to address the codecov/patch gap (was 50% vs 62.25% target). CI was otherwise green on the prior run.

If this looks good to you, would you be able to merge when checks pass? Happy to address anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add velero_build_info metric to metrics

2 participants