Skip to content
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

Unify Net::HTTP and Faraday implementations #2360

Merged
merged 3 commits into from
Aug 5, 2024

Conversation

solnic
Copy link
Collaborator

@solnic solnic commented Jul 31, 2024

Bonus refa after #2345

⚠️ this also fixes a bug that I found in Faraday instrumenter where it would early return nil if Sentry is not initialized instead of issuing a request. See 259f223

#skip-changelog

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.69%. Comparing base (09f348e) to head (04dde2d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2360      +/-   ##
==========================================
+ Coverage   98.68%   98.69%   +0.01%     
==========================================
  Files         207      208       +1     
  Lines       13741    13748       +7     
==========================================
+ Hits        13560    13569       +9     
+ Misses        181      179       -2     
Components Coverage Δ
sentry-ruby 99.05% <100.00%> (+0.01%) ⬆️
sentry-rails 97.41% <ø> (ø)
sentry-sidekiq 97.01% <ø> (ø)
sentry-resque 97.11% <ø> (+0.32%) ⬆️
sentry-delayed_job 98.92% <ø> (ø)
sentry-opentelemetry 100.00% <ø> (ø)
Files Coverage Δ
sentry-ruby/lib/sentry/faraday.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/net/http.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/utils/http_tracing.rb 100.00% <100.00%> (ø)
sentry-ruby/spec/sentry/faraday_spec.rb 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@solnic solnic force-pushed the solnic/unify-net-http-and-faraday branch from 7c83e6f to 259f223 Compare August 2, 2024 10:21
@solnic solnic marked this pull request as ready for review August 2, 2024 10:23
@solnic solnic requested a review from sl0thentr0py August 2, 2024 10:23
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one comment

sentry-ruby/lib/sentry/utils/http_tracing.rb Show resolved Hide resolved
@solnic solnic force-pushed the solnic/unify-net-http-and-faraday branch from 259f223 to 3549d8d Compare August 5, 2024 09:20
def propagate_trace?(url)
url &&
Sentry.initialized? &&
Sentry.configuration.propagate_traces &&
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sl0thentr0py given that direct access to the configuration is not thread-safe, we could have a method for checking configuration values that would perform this additonal initialize? check, something like:

Sentry.configuration(:propagate_traces)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to to add a helper but the semantics of that (truthy or falsey?) are not always clean.

@solnic solnic requested a review from sl0thentr0py August 5, 2024 09:25
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty!

@sl0thentr0py sl0thentr0py merged commit ef1eeb3 into master Aug 5, 2024
125 of 126 checks passed
@sl0thentr0py sl0thentr0py deleted the solnic/unify-net-http-and-faraday branch August 5, 2024 10:00
@solnic solnic mentioned this pull request Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants