Skip to content

feat: capture retry metrics in OTEL spans and Prometheus (#456) - #458

Open
rysweet wants to merge 1 commit into
mainfrom
feat/456-retry-metrics
Open

feat: capture retry metrics in OTEL spans and Prometheus (#456)#458
rysweet wants to merge 1 commit into
mainfrom
feat/456-retry-metrics

Conversation

@rysweet

@rysweet rysweet commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Changes

Surfaces Azure API retry statistics in both OTEL spans and Prometheus counters. Previously, retries were invisible — only logged as tracing::warn inside RustyClawd.

OTEL Span Fields (on llm.request)

  • retries — number of retry attempts (0 = first-try success)
  • retry_wait_ms — cumulative backoff wait time in ms
  • retry_reason — classified reason (RateLimited, Unauthorized, ServerError, etc.)

Prometheus Metrics

  • skwaq_gym_api_retries_total{suite, reason} — counter of API retry attempts
  • skwaq_gym_api_retry_wait_seconds{suite} — histogram of retry wait times

Dependency

  • Bumps RustyClawd to 54e9e88 (PR #654) which exposes RetryStats from create_message() and execute_with_tools().

Testing

  • 502 core tests pass, 279 gym tests pass (1 pre-existing failure in improve.rs)
  • Clippy clean

Closes #456

- 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>
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.

feat: capture Azure retry metrics in OTEL spans and Prometheus

1 participant