feat: capture retry metrics in OTEL spans and Prometheus (#456) - #458
Open
rysweet wants to merge 1 commit into
Open
feat: capture retry metrics in OTEL spans and Prometheus (#456)#458rysweet wants to merge 1 commit into
rysweet wants to merge 1 commit into
Conversation
- Add retries, retry_wait_ms, retry_reason fields to llm.request span
- Add skwaq_gym_api_retries_total{suite,reason} counter
- Add skwaq_gym_api_retry_wait_seconds{suite} histogram
- Bump RustyClawd to 54e9e88 (RetryStats API)
Closes #456
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Changes
Surfaces Azure API retry statistics in both OTEL spans and Prometheus counters. Previously, retries were invisible — only logged as
tracing::warninside RustyClawd.OTEL Span Fields (on
llm.request)retries— number of retry attempts (0 = first-try success)retry_wait_ms— cumulative backoff wait time in msretry_reason— classified reason (RateLimited, Unauthorized, ServerError, etc.)Prometheus Metrics
skwaq_gym_api_retries_total{suite, reason}— counter of API retry attemptsskwaq_gym_api_retry_wait_seconds{suite}— histogram of retry wait timesDependency
54e9e88(PR #654) which exposesRetryStatsfromcreate_message()andexecute_with_tools().Testing
improve.rs)Closes #456