Skip to content

fix: Populate the switchyard.router_retry_recovered metric - #474

Open
grahamking wants to merge 1 commit into
mainfrom
gk-retry-recovered-metric
Open

fix: Populate the switchyard.router_retry_recovered metric#474
grahamking wants to merge 1 commit into
mainfrom
gk-retry-recovered-metric

Conversation

@grahamking

@grahamking grahamking commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

This counts when a remote model call failed and needed retrying.

Assisted-by: Codex:GPT 5.6 Sol medium
Signed-off-by: Graham King grahamk@nvidia.com

Summary by CodeRabbit

  • Metrics
    • Added tracking for upstream operations that succeed after one or more retries.
    • Updated metric documentation to describe retry recovery accurately.
  • Tests
    • Added coverage confirming the retry-recovery metric increments after a transient failure is successfully resolved.

@grahamking
grahamking requested a review from a team as a code owner August 18, 2026 19:41
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 80c457a8-e33b-44cc-908e-7ccf04b1a59c

📥 Commits

Reviewing files that changed from the base of the PR and between 395c202 and 37b3088.

📒 Files selected for processing (5)
  • crates/libsy-llm-client/src/client.rs
  • crates/libsy-llm-client/src/metrics.rs
  • crates/switchyard-server/README.md
  • crates/switchyard-server/tests/server.rs
  • docs/internal/metrics_reference.md

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


Walkthrough

Successful upstream requests now increment a retry-recovery metric when they follow one or more retries. Integration tests simulate a transient 503 and verify the counter. Metric documentation now describes the counter behavior.

Changes

Retry recovery metric

Layer / File(s) Summary
Retry recovery instrumentation
crates/libsy-llm-client/src/metrics.rs, crates/libsy-llm-client/src/client.rs, crates/switchyard-server/README.md, docs/internal/metrics_reference.md
The client records switchyard.router_retry_recovered after a successful request that follows a retry. The metric documentation describes this behavior.
Retry recovery integration test
crates/switchyard-server/tests/server.rs
The mock upstream returns a transient 503 on the first matching attempt. The test enables one retry and verifies that the recovery counter increases by one.

Estimated code review effort: 2 (Simple) | ~15 minutes

Merge Risk: ⚪ Minimal · up to 37b30

This localized change populates retry-recovery metrics and updates related tests and documentation; no actionable merge-blocking risk remains beyond normal validation.

Poem

I nibbled the retry trail,
A 503 became a tale.
One more hop, the request flew,
The recovery count grew too.
Squeak—metrics now prevail!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: populating the retry recovery metric.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

This counts when a remote model call failed and needed retrying.

Assisted-by: Codex:GPT 5.6 Sol medium
Assisted-by: Cursor:Grok 4.6 high
Signed-off-by: Graham King <grahamk@nvidia.com>
@grahamking
grahamking force-pushed the gk-retry-recovered-metric branch from 37b3088 to d251029 Compare August 18, 2026 19:54
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://NVIDIA-NeMo.github.io/Switchyard/pr-preview/pr-474/

Built to branch gh-pages at 2026-08-18 20:17 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant