feat(metrics-endpoint): count /metrics scrape failures by outcome#3686
feat(metrics-endpoint): count /metrics scrape failures by outcome#3686hatamzad-nv wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Summary by CodeRabbit
WalkthroughThe metrics endpoint now emits ChangesMetrics scrape observability
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ScrapeHandler as Metrics scrape handler
participant FailureEvent as MetricsScrapeFailed
participant Counter as Failure counter
ScrapeHandler->>FailureEvent: emit labeled failure outcome
FailureEvent->>Counter: increment outcome counter
ScrapeHandler-->>ScrapeHandler: return HTTP error response
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-3686.docs.buildwithfern.com/infra-controller |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/metrics-endpoint/src/lib.rs`:
- Around line 591-628: Update the test scrape_failures_count_per_outcome to
invoke handle_metrics_request for each failure scenario instead of emitting
MetricsScrapeFailed directly. Use a table-driven set of cases that exercises all
five handler failure outcomes, then assert carbide_metrics_scrape_failures_total
deltas for every outcome label, including zero where appropriate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 03dceb13-5362-4cd2-b120-b965825b69a2
📒 Files selected for processing (3)
crates/metrics-endpoint/Cargo.tomlcrates/metrics-endpoint/src/lib.rsdocs/observability/core_metrics.md
ff978be to
5ae90e8
Compare
|
Good call — reworked the tests to drive the handler rather than emit directly. |
The shared metrics-endpoint handler can fail a scrape five distinct ways (encoder queue full -> 503; encoder gone, encode error, encoder panic, dropped reply -> 500). Each was only logged. Add a carbide_metrics_scrape_failures_total counter, labeled by a bounded ScrapeOutcome enum, emitted at each failure branch alongside the existing logs. This meta-observability surfaces a busy or erroring encoder on the next successful scrape, where aggregatable/alertable counters beat logs alone. Closes NVIDIA#3546
5ae90e8 to
6348f12
Compare
Closes #3546. Adds a carbide_metrics_scrape_failures_total counter labeled by a bounded ScrapeOutcome enum, emitted at each of the five /metrics failure branches alongside the existing logs. Includes a catalogue row in docs/observability/core_metrics.md and a unit test.