refactor(fmds): serve /metrics through the shared metrics-endpoint crate#3523
Conversation
|
@coderabbitai full_review, thanks! |
|
ヽ(•‿•)ノ ✅ Action performedFull review finished. |
|
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)
Summary by CodeRabbit
Walkthroughfmds now uses the shared ChangesMetrics endpoint migration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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/fmds/src/main.rs`:
- Around line 120-121: Update the log immediately before
metrics_endpoint::run_metrics_endpoint to say “starting” instead of “listening,”
or remove it, since binding has not succeeded yet. Keep the runner’s post-bind
listening log as the authoritative success message.
🪄 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: ef8174fb-d958-49ee-b8e9-22f5807d583c
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
crates/fmds/Cargo.tomlcrates/fmds/src/http_request_metrics.rscrates/fmds/src/main.rs
fmds served `/metrics` from its own axum router -- a `nest("/metrics", ...)` over a hand-written `export_metrics` handler. That duplicates the shared `metrics-endpoint` crate the rest of the fleet uses, so this hands fmds's existing Prometheus registry to `metrics_endpoint::run_metrics_endpoint` and deletes the bespoke router.
- The metrics server now builds a `MetricsEndpointConfig` over the registry `http_request_metrics::init()` produces and serves it, keeping the same bind address and task structure.
- `metrics_router` and `export_metrics` are gone, along with their now-unused axum and encoder imports; `init()` (the meter setup) is untouched.
The endpoint serves the same registry through the same `TextEncoder`, so `/metrics` stays byte-identical; it also answers `/health`, `/ready`, and `/` on the same port, matching the other migrated services.
Tests pass!
This supports NVIDIA#3180
Signed-off-by: Chet Nichols III <chetn@nvidia.com>
|
Good catch @coderabbitai -- removed the premature |
|
@coderabbitai full_review, thanks! |
|
Tip For best results, initiate chat on the files or code changes.
|
|
✅ Action performedFull review finished. |
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
fmds served
/metricsfrom its own axum router -- anest("/metrics", ...)over a hand-writtenexport_metricshandler. That duplicates the sharedmetrics-endpointcrate the rest of the fleet uses, so this hands fmds's existing Prometheus registry tometrics_endpoint::run_metrics_endpointand deletes the bespoke router.MetricsEndpointConfigover the registryhttp_request_metrics::init()produces and serves it, keeping the same bind address and task structure.metrics_routerandexport_metricsare gone, along with their now-unused axum and encoder imports;init()(the meter setup) is untouched.The endpoint serves the same registry through the same
TextEncoder, so/metricsstays byte-identical; it also answers/health,/ready, and/on the same port, matching the other migrated services.This supports #3180