Skip to content

forgot to save a file before commit and push

ab577dc
Select commit
Loading
Failed to load commit list.
Merged

feat(transport): Add EnvelopePrinterTransport for debug logging #6181

forgot to save a file before commit and push
ab577dc
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed May 1, 2026 in 57s

2 issues

Medium

EnvelopePrinterTransport performs serialization and file I/O even when debug logging is disabled - `sentry_sdk/transport.py:1098-1121`

capture_envelope unconditionally calls json.dumps on envelope/item headers and item.get_bytes() on every item before passing the args to logger.debug. Because logger.debug only formats arguments when the debug level is enabled, the wrapper still pays the full cost (including potential disk reads inside Item.get_bytes when the payload is backed by a file path) on every send, regardless of log level. This contradicts the PR description's claim of 'no runtime cost' when enabled but logger is not at debug, and adds latency/allocations on the hot send path.

Low

Overriding __class__ to masquerade as the inner transport can break isinstance/type checks elsewhere - `sentry_sdk/transport.py:1094-1096`

The __class__ property returns self._inner.__class__, causing type(wrapper) and isinstance(wrapper, ...) to report the wrapped transport's class. Code elsewhere that branches on transport type (e.g. checks for HttpTransport vs AsyncHttpTransport, or that uses type(...).__name__ for diagnostics) will be silently misled, and the same applies to debuggers and error reporting. This is a non-obvious side effect that could confuse future maintainers and tooling.

4 skills analyzed
Skill Findings Duration Cost
code-review 2 49.6s $0.57
find-bugs 0 52.0s $0.62
skill-scanner 0 15.2s $0.28
security-review 0 16.9s $0.26

Duration: 2m 14s · Tokens: 477.8k in / 4.3k out · Cost: $1.74 (+merge: $0.00, +dedup: $0.01)