Repository navigation
Fix telemetry metrics configuration - #76
Open
behinddwalls wants to merge 2 commits into
Open
behinddwalls wants to merge 2 commits into
behinddwalls wants to merge 2 commits into
Conversation
## Summary ### Why? `telemetry.metrics = false` did not affect server startup or routing, so the recorder was always installed and `/metrics` remained available. ### What? Install the Prometheus recorder and authenticated route only when metrics are enabled. Reserve `/metrics` with an explicit 404 when disabled so the SPA owner route cannot handle it. Add enabled/disabled HTTP coverage to the fast suite. ## Test Plan - ✅ `cargo test -p walgit-server --test metrics --test routing_prefix` - ✅ `cargo clippy -p walgit-server --all-targets -- -D warnings` - ✅ `cargo fmt --all -- --check` ## Issue Closes tobi#75
behinddwalls
marked this pull request as ready for review
September 30, 2026 17:48
Contributor
|
Checked this against main and you're right, the recorder gets installed and /metrics is served no matter what |
Use the optional Prometheus handle when constructing the router and inject the enabled handle into the route. The handler can now render without rechecking an impossible disabled state.
Author
|
Removed the redundant disabled-state check in [addressed by agent] |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why?
telemetry.metrics = falsedid not affect server startup or routing, so the recorder was always installed and/metricsremained available.What?
Install the Prometheus recorder and authenticated route only when metrics are enabled. Reserve
/metricswith an explicit 404 when disabled so the SPA owner route cannot handle it. Add enabled/disabled HTTP coverage to the fast suite.Test Plan
cargo test -p walgit-server --test metrics --test routing_prefixcargo clippy -p walgit-server --all-targets -- -D warningscargo fmt --all -- --checkIssue
Closes #75