Skip to content

Propagated sampling rates #2671

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

Merged
merged 20 commits into from
Aug 21, 2025
Merged

Propagated sampling rates #2671

merged 20 commits into from
Aug 21, 2025

Conversation

solnic
Copy link
Collaborator

@solnic solnic commented Jul 31, 2025

This ensures that we follow the spec as described here https://develop.sentry.dev/sdk/telemetry/traces/#propagated-random-value

@solnic solnic force-pushed the propagated-sampling-rates branch 3 times, most recently from fa9fe50 to e1b1e74 Compare August 11, 2025 09:46
@solnic solnic force-pushed the propagated-sampling-rates branch from e1b1e74 to e8da627 Compare August 12, 2025 15:18
@solnic solnic marked this pull request as ready for review August 12, 2025 15:18
@solnic solnic requested a review from sl0thentr0py August 12, 2025 15:19
@solnic solnic force-pushed the propagated-sampling-rates branch from e8da627 to 206704f Compare August 12, 2025 15:22
cursor[bot]

This comment was marked as outdated.

@solnic solnic force-pushed the propagated-sampling-rates branch 6 times, most recently from f054365 to c720d30 Compare August 13, 2025 09:55
cursor[bot]

This comment was marked as outdated.

@solnic solnic force-pushed the propagated-sampling-rates branch from c720d30 to 3581ae9 Compare August 13, 2025 10:08
cursor[bot]

This comment was marked as outdated.

@solnic solnic force-pushed the propagated-sampling-rates branch from 3581ae9 to 0fdbceb Compare August 13, 2025 11:36
cursor[bot]

This comment was marked as outdated.

@solnic solnic force-pushed the propagated-sampling-rates branch from 2706368 to 763c8ad Compare August 13, 2025 13:42
@getsentry getsentry deleted a comment from codecov bot Aug 14, 2025
Copy link

codecov bot commented Aug 14, 2025

Codecov Report

❌ Patch coverage is 98.92473% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.44%. Comparing base (dd8b418) to head (db7da2e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
sentry-ruby/lib/sentry/utils/sample_rand.rb 98.07% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2671      +/-   ##
==========================================
+ Coverage   97.39%   97.44%   +0.04%     
==========================================
  Files         135      136       +1     
  Lines        5229     5315      +86     
==========================================
+ Hits         5093     5179      +86     
  Misses        136      136              
Components Coverage Δ
sentry-ruby 97.76% <98.92%> (+0.02%) ⬆️
sentry-rails 96.10% <ø> (+0.14%) ⬆️
sentry-sidekiq 96.57% <ø> (ø)
sentry-resque 94.44% <ø> (ø)
sentry-delayed_job 94.68% <ø> (ø)
sentry-opentelemetry 99.31% <ø> (ø)
Files with missing lines Coverage Δ
sentry-ruby/lib/sentry-ruby.rb 99.14% <100.00%> (+<0.01%) ⬆️
sentry-ruby/lib/sentry/hub.rb 97.93% <ø> (ø)
sentry-ruby/lib/sentry/propagation_context.rb 97.40% <100.00%> (+0.91%) ⬆️
sentry-ruby/lib/sentry/transaction.rb 98.22% <100.00%> (+0.14%) ⬆️
sentry-ruby/lib/sentry/utils/sample_rand.rb 98.07% <98.07%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

logic looks perfect, nice work!

if we can avoid deduplication it would be great, but maybe I missed a reason why transaction needs its own logic. We will remove Transaction.from_sentry_trace completely in the major either way.

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.

some suggestions for the specs

@solnic solnic force-pushed the propagated-sampling-rates branch 2 times, most recently from 7a2d646 to 5ad2318 Compare August 19, 2025 08:04
cursor[bot]

This comment was marked as outdated.

@solnic solnic force-pushed the propagated-sampling-rates branch 2 times, most recently from 4ed23c3 to db1f2d8 Compare August 19, 2025 08:52
@solnic solnic force-pushed the propagated-sampling-rates branch from d85621e to 360d3bf Compare August 20, 2025 07:04
dsc_metadata
end

def get_http_server_transactions_with_headers
Copy link
Member

Choose a reason for hiding this comment

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

sorry if I'm blind but where are we using this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ugh sorry about that, messed up rebasing and unused methods kept reappearing, it's removed now :)

Copy link
Member

Choose a reason for hiding this comment

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

right, but then I wanted us to check the incoming request headers too by actually using this method, not removing it..

anyway it's just a spec so don't care that much, feel free to add it or not

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 OK added expectations for proper headers and stuff via db7da2e

@solnic solnic force-pushed the propagated-sampling-rates branch from 360d3bf to f1881f5 Compare August 21, 2025 11:12
cursor[bot]

This comment was marked as outdated.

@solnic solnic requested a review from sl0thentr0py August 21, 2025 11:37
@solnic solnic force-pushed the propagated-sampling-rates branch from 3fc0e46 to db7da2e Compare August 21, 2025 21:05
@solnic solnic merged commit 53f3b58 into master Aug 21, 2025
269 of 270 checks passed
@solnic solnic deleted the propagated-sampling-rates branch August 21, 2025 21:16
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