refactor(api): move metrics initialization into api crate#3860
Merged
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
WalkthroughAPI metrics ownership moves into ChangesAPI metrics lifecycle
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant api_run as api::run::run
participant metrics as api::metrics::setup_metrics
participant endpoint as start_metrics_endpoint
participant core as api_core::run_core
participant tasks as Tokio JoinSet
api_run->>metrics: initialize Prometheus/OpenTelemetry metrics
metrics-->>api_run: return registry and meter
api_run->>endpoint: spawn optional metrics server
api_run->>core: provide meter and shared JoinSet
core-->>api_run: return after API startup
api_run->>tasks: wait with join_all
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
poroh
force-pushed
the
api-bootstrap/02-metrics
branch
from
July 22, 2026 18:20
02baecb to
38411bd
Compare
10 tasks
Move metrics provider and endpoint setup into the top-level carbide-api composition crate. Transfer JoinSet ownership with it so process tasks are awaited outside api-core while core service initialization remains unchanged. Preserve the existing metric views and regression coverage, and remove metrics-bootstrap dependencies that api-core no longer uses. Signed-off-by: Dmitry Porokh <dporokh@nvidia.com>
poroh
force-pushed
the
api-bootstrap/02-metrics
branch
from
July 22, 2026 19:37
38411bd to
06a66c3
Compare
poroh
marked this pull request as ready for review
July 22, 2026 19:37
chet
approved these changes
Jul 22, 2026
poroh
enabled auto-merge (squash)
July 22, 2026 19:58
10 tasks
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.
Reduce the scope and growth of
carbide-api-coreby moving process initialization into thecarbide-apicomposition crate. This PR moves metrics initialization, metrics endpoint startup, and process task ownership without intended functional or configuration changes.This is the second change in a planned series:
runentry point - refactor(api): move logging initialization into api crate #3851.The existing metric views and gauge regression coverage are preserved. Metrics-bootstrap dependencies that are no longer used by
api-coremove with the implementation.Related issues
#3851
Type of Change
Breaking Changes
Testing
Additional Notes
This PR is stacked on #3851 and should merge after it.