Repository navigation
docs: put Sentry inside the exception handler in the documented interceptor order - #51
Merged
Merged
Conversation
…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
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.
Summary
The module docstring of
grpc_server_kit/aio/interceptors/__init__.pygave the canonical order withAsyncSentryInterceptor(5) outsideAsyncExceptionHandlerInterceptor(6). Everything else says the opposite: theAsyncSentryInterceptordocstring,GrpcServerInterceptorsProvider, the README, the quickstart, interceptors and observability guides,docs/agents.mdandexamples/observability_chain.py. Following the docstring, Sentry only sees theAbortErrorthe handler produces and captures nothing.grpc_server_providers()builds (minusDishkaAioInterceptor). 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
Checklist
make checkpasses locally (ruff+mypy)docs/agents.mdincluded — no API change;docs/agents.mdalready had the right orderRelated issues
Fixes #49