feat: surface drain_timeout on the bundled Prometheus/OTel adapters#96
Merged
Conversation
#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
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]>
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.
What
Completes the
drain_timeoutfeature from #92. That PR added thedrain_timeoutrecorder event (emitted when astop()drain exceedsgraceful_timeoutand 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.faststream_outbox_drain_timeout_totalcounter (consume labels).messaging.outbox.drain_timeoutmeter counter (operation=process).docs/usage/observability.mdrecorder-event table + event set;CLAUDE.mdandarchitecture/metrics.mdemission lists.Added
PLR0911to the two adapters'__call__noqa — one more branch in the flat event-dispatch chain, same shape as the existingC901/PLR0912suppressions on those methods.Tests
test_prometheus_drain_timeout_increments,test_otel_drain_timeout_emits_counter.just test→ 518 passed, 100% coverage;just lintclean;mkdocs build --strictpasses.Lands before the 0.10.0 release so the drain-observability feature is whole at ship time.
🤖 Generated with Claude Code