Allow proxy configuration via HTTP_PROXY env var#2161
Allow proxy configuration via HTTP_PROXY env var#2161st0012 merged 5 commits intogetsentry:masterfrom
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2161 +/- ##
=======================================
Coverage 97.33% 97.34%
=======================================
Files 97 99 +2
Lines 3638 3687 +49
=======================================
+ Hits 3541 3589 +48
- Misses 97 98 +1
|
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
Curiously, it fails for Ruby 2.4: https://github.com/getsentry/sentry-ruby/actions/runs/6755752783/job/18365644960?pr=2161#step:6:1523 I'll try it out locally and make a workaround. |
|
I'm still on this — proved to be difficult to get to locally (2.4 doesn't easily install on M1 with |
|
@sl0thentr0py if you're in the mood to merge things — can you help me out with this one? I was hitting a wall on that Ruby 2.4 test. |
|
i'll look tomorrow, irl now |
|
The CI fails because Ruby didn't support getting user/pass from |
|
@st0012 TIL. Fixed! |
|
Thank you for the fix as well as the new documentation!! |
|
I'll make a follow up docs PR when we ship this out. |
|
@natikgadzhi any idea when this fix will be pushed in self hosted dev release? |
|
Since this is on the client SDK side, and it already shipped in 5.14, just update your sentry-ruby, it should already work against both SaaS, and a self-hosted Sentry.
This patch only controls whether the client SDK will use a proxy to send data to the server. Point it to a self-hosted DSN and it should work.
|
Summary
This PR allows
sentry-rubyto use proxy config passed via environment variables, i.e.HTTP_PROXY. Closes #2131. The actual configuration settings is still respected over environment variables.Changes
nilpassed into::Net::HTTP, and allows it to do all the work for us.TODOs
sentry-ruby/sentry-ruby/spec/sentry/transport/http_transport_spec.rb
Line 94 in c9b4eac
sentry-docsto document how proxy config works. As of right now,transport_configurationblock there is minimal.sentry-docswith proxy via env var support.Review
config.transport_configuration.proxyis preferred over the environment values:config.transport_configuration.proxyis present, but malformed (does not have the minimally required uri key), it will still be used overHTTP_PROXY, even if that has the correct setup.