-
Notifications
You must be signed in to change notification settings - Fork 103
fix(ds): Emit dynamic sampling outcomes for spans contained in transaction #4569
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
Conversation
e9e816e
to
2f59f50
Compare
2f59f50
to
dd58c9d
Compare
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.
Left a minor comment
// | ||
// This is yet another case, when the spans have not yet been separated from the transaction | ||
// also emit dynamic sampling outcomes for the contained spans. | ||
if !spans_extracted.0 { |
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.
nit: Assuming top-level extracted spans are in the dropped_items
list, isn't it cleaner to read it from there and sum them up?
It's for sure more expensive because we would have to iterate but maybe it's clearer.
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.
It would be the wrong signal, we have that explicit boolean which makes the decision if the contained spans should be counted or not (it's the spans_extracted
here).
In theory it's possible to have a transaction and spans in the same envelope and then it becomes messy, so the boolean is the one thing that should always accurately track that state.
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.
Yeah, I was not referring to the condition, I was referring to the counting of spans through dropped items of type ItemType::Span
.
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.
dropped_items
will not contain any spans if spans_extracted
is false.
When changing the span outcomes in #4569, I fixed this test incorrectly making it flaky. When the test runner is fast enough it would never fail (locally) but in CI this was noticed because the tests run slower. This is the correct fix.
Dynamic sampling currently only emits outcomes for the transaction but not the contained spans. With this PR sampled/filtered outcomes are also emitted for contained spans.