-
-
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
add delayed job context into the sampling context #2148
add delayed job context into the sampling context #2148
Conversation
Agree that this could be super useful! |
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.
Code changes LGTM and everything has been tested!
Codecov Report
@@ Coverage Diff @@
## master #2148 +/- ##
==========================================
+ Coverage 97.27% 97.30% +0.02%
==========================================
Files 97 97
Lines 3632 3634 +2
==========================================
+ Hits 3533 3536 +3
+ Misses 99 98 -1
|
@sl0thentr0py In other SDKs, is there a format to add job contexts as sampling context? Perhaps we should adopt this in other integrations as well? If so, then we should probably add |
@st0012 yes let's put it under |
Hi @st0012 , @sl0thentr0py , thanks for looking at this. There are at most two keys being set in the |
ok fine with me then! |
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.
Ah I see. I now regret defining those keys with camelcase + dash. But I guess it's too late to change 🤦♂️
@rlineweaver Thank you for this PR 🙌 |
Description
This makes additional job context available in the
sampling_context
via the Sentry transaction'scustom_sampling_context
, which makes it available for making sampling rate determinations intraces_sampler
. In our case, we want to base the sampling rate off of the job's priority. This PR allows you to write code like: