Skip to content

docs: put Sentry inside the exception handler in the documented interceptor order - #51

Merged
AlexeyShalaev merged 1 commit into
masterfrom
docs/49-sentry-interceptor-order
Oct 16, 2026
Merged

AlexeyShalaev merged 1 commit into
masterfrom
docs/49-sentry-interceptor-order

Conversation

@AlexeyShalaev

Copy link
Copy Markdown
Member

Summary

The module docstring of grpc_server_kit/aio/interceptors/__init__.py gave the canonical order with AsyncSentryInterceptor (5) outside AsyncExceptionHandlerInterceptor (6). Everything else says the opposite: the AsyncSentryInterceptor docstring, GrpcServerInterceptorsProvider, the README, the quickstart, interceptors and observability guides, docs/agents.md and examples/observability_chain.py. Following the docstring, Sentry only sees the AbortError the handler produces and captures nothing.

  • Swapped items 5 and 6 and added one line on why Sentry sits inside the handler.
  • New unit test: reads the numbered list out of the module docstring and compares it with the chain grpc_server_providers() builds (minus DishkaAioInterceptor). The docstring and the provider drifted apart once; the test keeps them together. With master's docstring it fails at index 4 ('AsyncSentryInterceptor' != 'AsyncExceptionHandlerInterceptor').

No code change; the rest of the docs were already right. The API reference page renders this docstring, so it picks the fix up on the next docs build.

Tests

  • ruff check, ruff format --check, mypy grpc_server_kit: clean.
  • pytest --cov: 439 passed, 97.60% coverage.

Type of change

  • Documentation update

Checklist

  • Tests added or updated
  • make check passes locally (ruff + mypy)
  • Conventional-commit title (the changelog is generated by Release Please — do not edit it by hand)
  • Documentation updated (if the public API changed), docs/agents.md included — no API change; docs/agents.md already had the right order

Related issues

Fixes #49

…ceptor order

The module docstring of grpc_server_kit.aio.interceptors listed
AsyncSentryInterceptor before AsyncExceptionHandlerInterceptor, the
opposite of the provider, the Sentry docstring and every guide. Followed
as written, Sentry only sees the AbortError the handler produces and
captures nothing.

A test now compares the documented order with the chain the dishka
provider builds.

Fixes #49
@AlexeyShalaev
AlexeyShalaev merged commit d2f6181 into master Oct 16, 2026
6 checks passed
@AlexeyShalaev
AlexeyShalaev deleted the docs/49-sentry-interceptor-order branch October 16, 2026 14:38
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.

The documented interceptor order puts Sentry outside the exception handler; sentry.py and the dishka provider put it inside

1 participant