Skip to content

Avoid duplicated sampling on Transaction events#1601

Merged
st0012 merged 6 commits intomasterfrom
fix-event-sending-restriction
Nov 4, 2021
Merged

Avoid duplicated sampling on Transaction events#1601
st0012 merged 6 commits intomasterfrom
fix-event-sending-restriction

Conversation

@st0012
Copy link
Copy Markdown
Contributor

@st0012 st0012 commented Oct 31, 2021

As @sl0thentr0py pointed out on discord, having sample_allowed? inside sending_allowed? causes double sampling on transaction events and should be avoided. So this PR fixes the issue and removes an unnecessary sending check from the Transport class.

@st0012 st0012 added this to the 4.8.0 milestone Oct 31, 2021
@st0012 st0012 self-assigned this Oct 31, 2021
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 31, 2021

Codecov Report

Merging #1601 (915a105) into master (ffc59a3) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1601      +/-   ##
==========================================
- Coverage   98.47%   98.44%   -0.03%     
==========================================
  Files         130      130              
  Lines        7223     7223              
==========================================
- Hits         7113     7111       -2     
- Misses        110      112       +2     
Impacted Files Coverage Δ
sentry-ruby/lib/sentry/transport.rb 98.18% <ø> (-0.16%) ⬇️
sentry-ruby/spec/sentry/transport_spec.rb 100.00% <ø> (ø)
sentry-ruby/lib/sentry/client.rb 97.46% <100.00%> (+0.03%) ⬆️
sentry-ruby/lib/sentry/configuration.rb 98.36% <100.00%> (-1.10%) ⬇️
...ntry-ruby/spec/sentry/client/event_sending_spec.rb 99.57% <100.00%> (+0.03%) ⬆️
sentry-ruby/spec/sentry/configuration_spec.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ffc59a3...915a105. Read the comment docs.

@st0012 st0012 requested a review from sl0thentr0py October 31, 2021 09:45
Transport should only care about sending the event object to the right
destination with right format. It doesn't need to check if it's allowed
to send an event, which should already be done by
`Client#capture_event`.
@st0012 st0012 force-pushed the fix-event-sending-restriction branch from 0154afb to c623b0e Compare October 31, 2021 10:06
@st0012 st0012 force-pushed the fix-event-sending-restriction branch from c623b0e to 915a105 Compare October 31, 2021 10:08
Copy link
Copy Markdown
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.

thx for the quick fix @st0012!
Looks good to my newbie eyes, just one minor optimization suggestion but can also ignore

Co-authored-by: Neel Shah <neelshah.sa@gmail.com>
@st0012 st0012 merged commit 1bf154e into master Nov 4, 2021
@st0012 st0012 deleted the fix-event-sending-restriction branch November 4, 2021 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants