-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/tailsampling] Fix SpanCount sampler not using the correct span count for decision #13386
[processor/tailsampling] Fix SpanCount sampler not using the correct span count for decision #13386
Conversation
Signed-off-by: Miguel Alexandre <[email protected]>
Signed-off-by: Miguel Alexandre <[email protected]>
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
@dmitryax can you approve the the running workflows and take a look at the PR? Thank you! |
if trace.SpanCount() >= int(c.minSpans) { | ||
return Sampled, nil | ||
} | ||
if int(traceData.SpanCount.Load()) >= int(c.minSpans) { |
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.
Could you please add a new test, to demonstrate the problem and ensure we don't have a regression in the future?
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.
Looks like 1 of the tests was already covering this but with the incorrect expected outcome. Fixed it and should now cover this logic.
Is there a GitHub issue tracking this? |
@jpkrohling there wasn't but I created #13865 to track it and updated the changelog |
d4dace5
to
ad2f932
Compare
Signed-off-by: Miguel Alexandre <[email protected]>
Signed-off-by: Miguel Alexandre <[email protected]>
ad2f932
to
28e4096
Compare
An issue isn't strictly required, although bug reports usually start with an issue. I'll review this soon. |
processor/tailsamplingprocessor/internal/sampling/span_count_sampler_test.go
Show resolved
Hide resolved
processor/tailsamplingprocessor/internal/sampling/span_count_sampler_test.go
Show resolved
Hide resolved
Signed-off-by: Miguel Alexandre <[email protected]>
[]int32{ | ||
1, 1, 1, | ||
}, | ||
Sampled, |
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.
Previously, this was not sampled. This was the bug, right?
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.
Yes, that's right
Fixes #13865
Description:
There is a bug with the SpanCount sampler. If spans are put in different batches, it may make a wrong decision.
e.g.
With SpanCount minSpans set to
2
; if 2 spans of the same trace are put into different batches, the trace will not be sampled.