-
Notifications
You must be signed in to change notification settings - Fork 556
Closed
getsentry/sentry-docs
#14816Labels
Description
Problem Statement
The SDK is currently providing initialization options http_proxy
,https_proxy
and relying on environment variables for fallback. If I want to bypass proxy config altogether, I have to set
sentry_sdk.init(
https_proxy="",
http_proxy="",
)
Which requires reading SDK logic for handling proxy (which may change in the future)
The current hack is also subtly different from
sentry_sdk.init(
https_proxy=None,
http_proxy=None,
)
(which will fallback to env vars and NOT what I want)
In my use case where sentry_sdk
is deployed to many services, I don't have control over environment variables and need an option to disable/bypass proxy in Sentry SDK's internal transport.
Solution Brainstorm
File: sentry_sdk/consts.py
def __init__(
self,
# ... other parameters ...
no_proxy=False, # type: bool
# ... other parameters ...
):
File: sentry_sdk/transport.py
def _in_no_proxy(self, parsed_dsn):
# type: (Self, Dsn) -> bool
if self.options["no_proxy"]:
return True
no_proxy = getproxies().get("no")
if not no_proxy:
return False
# ... existing environment variable logic ...
Metadata
Metadata
Assignees
Labels
Projects
Status
No status