add delayed job context into the sampling context#2148
add delayed job context into the sampling context#2148st0012 merged 4 commits intogetsentry:masterfrom
Conversation
|
Agree that this could be super useful! |
booleanbetrayal
left a comment
There was a problem hiding this comment.
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! |
st0012
left a comment
There was a problem hiding this comment.
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_contextvia 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: