Send events without proxy when http_proxy is configured as env variable
See original GitHub issueHi,
I have problem with configuration of sentry_sdk. My code is behind corporate proxy and http_proxy
is configured on machine as env variable (required when I want to install something via pip for example). Also I have env variable no_proxy
where I added ip address for host where sentry is working (this ip is inside corporate network). When I try send event to sentry I got return code 403 (proxy refuse request). Probably sentry_sdk automacally fetch proxy from http_proxy env but ignore no_proxy. When I remove http_proxy from env everything is working. How can I configure python_sdk to ignore my http_proxy env variable? My code:
import logging
import sentry_sdk
from sentry_sdk.integrations.logging import LoggingIntegration
sentry_logging = LoggingIntegration(
level=logging.INFO,
event_level=logging.ERROR
)
sentry_sdk.init(
dsn="<dsn>",
integrations=[sentry_logging],
debug=True,
)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
We need to talk: Can we standardize NO_PROXY? - GitLab
Today, most Web clients support connection to proxy servers via environment variables: http_proxy / HTTP_PROXY; https_proxy / HTTPS_PROXY ...
Read more >Working with HTTP Proxies | OpenShift Container Platform 3.11
Configuring Hosts for Proxies Using Ansible. During cluster installations, the NO_PROXY , HTTP_PROXY , and HTTPS_PROXY environment variables can be configured ...
Read more >Working with Proxies - Chef Software
To configure proxy settings in Windows: Open System Properties. Open Environment Variables. Open System variables. Set http_proxy and ...
Read more >Configuring Proxy Settings for All Apps | Pivotal Docs
Exclude an App From Global Proxy Settings · Set the proxy environment variables for http_proxy to an empty value by running: cf set-env...
Read more >Using the cf CLI with a Proxy Server | Cloud Foundry Docs
The https_proxy environment variable holds the hostname or IP address ... cf ssh command for cf CLI v7 does not work through a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
no_proxy
env var is widely used. I strongly feel that if an application reads fromhttp_proxy
it should also respect theno_proxy
variable. Please consider supporting it, thanks.To keep this issue updated: We discussed this internally and decided on a hard rule not to use requests. The reason for this is that we would like to explicitly control which behavior we support (since all of the new SDKs share a single piece of documentation describing that behavior, and the behavior across SDKs and across languages should be the same), and requests ideologically is the opposite of that: I for one was unaware that requests reads environment variables like that, even though I’ve been using it for quite a while.
I would propose that we keep the current, simple, stupid proxying behavior, but add a new flag that disables any access to the process environment. Is this an acceptable fix?