-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
Allow proxy configuration via HTTP_PROXY env var #2161
Allow proxy configuration via HTTP_PROXY env var #2161
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 <[email protected]>
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 |
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.
👍 Sorry for the delay
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-ruby
to use proxy config passed via environment variables, i.e.HTTP_PROXY
. Closes #2131. The actual configuration settings is still respected over environment variables.Changes
nil
passed 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-docs
to document how proxy config works. As of right now,transport_configuration
block there is minimal.sentry-docs
with proxy via env var support.Review
config.transport_configuration.proxy
is preferred over the environment values:config.transport_configuration.proxy
is 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.