-
Notifications
You must be signed in to change notification settings - Fork 572
feat(stdlib): Handle proxy tunnels in httlib integration #5303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7c49a36 to
bf37a48
Compare
Semver Impact of This PR
🟡 Minor (new features)
📋 Changelog Preview
This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).
New Features ✨
- feat(asyncio): Add on-demand way to enable AsyncioIntegration by sentrivana in #5288
- feat(stdlib): Handle proxy tunnels in httlib integration by sl0thentr0py in #5303
Bug Fixes 🐛
- fix(ai): redact message parts content of type blob by constantinius in #5243
- fix(clickhouse): Guard against module shadowing by alexander-alderman-webb in #5250
- fix(gql): Revert signature change of patched gql.Client.execute by alexander-alderman-webb in #5289
- fix(grpc): Derive interception state from channel fields by alexander-alderman-webb in #5302
- fix(litellm): Guard against module shadowing by alexander-alderman-webb in #5249
- fix(pure-eval): Guard against module shadowing by alexander-alderman-webb in #5252
- fix(ray): Guard against module shadowing by alexander-alderman-webb in #5254
- fix(threading): Handle channels shadowing by sentrivana in #5299
- fix(typer): Guard against module shadowing by alexander-alderman-webb in #5253
Documentation 📚
- docs: Update Python versions banner in README by sentrivana in #5287
Internal Changes 🔧
- chore(gen_ai): add auto-enablement for google genai by shellmayr in #5295
- ci(release): Switch from action-prepare-release to Craft by BYK in #5290
🤖 This preview updates automatically when you update the PR.
sentry_sdk/integrations/stdlib.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are according to otel spec
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proxy port used when tunnel port is unspecified
Low Severity
When _tunnel_host is set but _tunnel_port is None (because set_tunnel was called without specifying a port), the code falls back to self.port which is the proxy port, not the tunnel destination port. This causes incorrect URL recording in the span. For example, if using HTTPConnection("proxy", 8080).set_tunnel("api.example.com") (no port), the recorded URL would incorrectly include :8080. The else branch assumes no tunnel is in use, but _tunnel_host being set indicates tunnel mode where the default port (80/443) is more appropriate than the proxy port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest changing the url recording logic instead.
Otherwise, looks good to me!
Issues