feat(transport): Add EnvelopePrinterTransport for debug logging#6181
Draft
ericapisani wants to merge 8 commits intomasterfrom
Draft
feat(transport): Add EnvelopePrinterTransport for debug logging#6181ericapisani wants to merge 8 commits intomasterfrom
ericapisani wants to merge 8 commits intomasterfrom
Conversation
Add a decorator transport that logs envelope contents via the SDK debug logger before forwarding to the inner transport. Activated by setting SENTRY_PRINT_ENVELOPES=1|true|yes. Includes tests for delegation, logging behavior, make_transport integration, and strict env var parsing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 7.38s All tests are passing successfully. ❌ Patch coverage is 46.00%. Project has 14962 uncovered lines. Files with missing lines (1)
Generated by Codecov Action |
Member
Author
|
bugbot run |
Member
Author
|
@sentry review |
…sport coverage - Override __class__ to delegate to inner transport so isinstance checks (e.g. AsyncHttpTransport) remain transparent - Add __getattr__ fallback for attributes not explicitly defined - Return values from flush() and kill() so async tasks propagate - Wrap transport in all make_transport paths (pre-instantiated, callable) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
bugbot run |
Member
Author
|
@sentry review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f050b85. Configure here.
…ry/sentry-python into envelope-printer-transport-zcgvd
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.
Adds
EnvelopePrinterTransport, a decorator transport that wraps the real transport and pretty-prints each envelope's headers and item payloads to the SDK debug logger before forwarding the envelope.Enabled via
SENTRY_PRINT_ENVELOPES=1(also acceptstrue/yes). When unset or falsy, no wrapping occurs and there's no runtime cost. Useful for local debugging without having to run a local Sentry instance or intercept network traffic.Fixes PY-2398
Fixes #6183