Skip to content

feat: surface drain_timeout on the bundled Prometheus/OTel adapters#96

Merged
lesnik512 merged 1 commit into
mainfrom
feat/drain-timeout-adapters
Jun 14, 2026
Merged

feat: surface drain_timeout on the bundled Prometheus/OTel adapters#96
lesnik512 merged 1 commit into
mainfrom
feat/drain-timeout-adapters

Conversation

@lesnik512

Copy link
Copy Markdown
Member

What

Completes the drain_timeout feature from #92. That PR added the drain_timeout recorder event (emitted when a stop() drain exceeds graceful_timeout and abandons in-flight rows to lease-expiry), but only the raw recorder seam saw it — the bundled adapters ignored it (forward-compatible) and the docs didn't mention it, so operators got no out-of-the-box metric.

  • Prometheusfaststream_outbox_drain_timeout_total counter (consume labels).
  • OpenTelemetrymessaging.outbox.drain_timeout meter counter (operation=process).
  • Docsdocs/usage/observability.md recorder-event table + event set; CLAUDE.md and architecture/metrics.md emission lists.

Added PLR0911 to the two adapters' __call__ noqa — one more branch in the flat event-dispatch chain, same shape as the existing C901/PLR0912 suppressions on those methods.

Tests

  • test_prometheus_drain_timeout_increments, test_otel_drain_timeout_emits_counter.
  • just test518 passed, 100% coverage; just lint clean; mkdocs build --strict passes.

Lands before the 0.10.0 release so the drain-observability feature is whole at ship time.

🤖 Generated with Claude Code

#92 added the drain_timeout recorder event but only the raw recorder seam saw it —
the bundled adapters ignored it (forward-compatible) and the docs didn't mention it,
so operators got no out-of-the-box metric. Complete the feature:

- Prometheus: faststream_outbox_drain_timeout_total counter (consume labels).
- OTel: messaging.outbox.drain_timeout meter counter (operation=process).
- Docs: observability.md recorder-event table + event set; CLAUDE.md and
  architecture/metrics.md emission lists.

Added PLR0911 to the two adapters' __call__ noqa (one more event branch in the flat
event-dispatch dispatch, same shape as the existing C901/PLR0912 suppressions).

Tests: test_{prometheus,otel}_drain_timeout_* assert the counter increments.
just test -> 518 passed, 100% coverage; just lint clean; mkdocs --strict builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@lesnik512 lesnik512 merged commit 0e96ec4 into main Jun 14, 2026
3 checks passed
@lesnik512 lesnik512 deleted the feat/drain-timeout-adapters branch June 14, 2026 14:40
lesnik512 added a commit that referenced this pull request Jun 14, 2026
…t adapters) (#97)

Covers PRs #85-#96: the F5-01 High fix, the F8-01 FastAPI dlq/recorder forwarding and
F3-01 last_exception_renderer features, the drain_timeout metric, the robustness/validation
fixes, and the test-hardening + docs sweep. Three behavior notes flagged for upgraders.

Tag-driven release: pushing the bare `0.10.0` tag publishes to PyPI.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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