-
Notifications
You must be signed in to change notification settings - Fork 440
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
fix for sampling root span #784
Conversation
Codecov Report
@@ Coverage Diff @@
## main #784 +/- ##
==========================================
+ Coverage 95.95% 96.00% +0.04%
==========================================
Files 176 176
Lines 7172 7186 +14
==========================================
+ Hits 6882 6899 +17
+ Misses 290 287 -3
|
} | ||
else | ||
{ | ||
return {Decision::DROP}; |
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.
Should we assert(false)
here? Seems invalid trace Id should not be passed to sampler.
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.
Instead of asserting in unit-test, better would be to fail the particular unit-test and let other tests run? Like in this case, ValidTraceIdToSampler
test will fail.
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, fail this particular unit-test works too.
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.
ok got it. Have changed it.
Fixes #782
Changes
Move span_context creation from sdk::Span to sdk::Tracer, and pass it in sdk::Span constructor. This also allows passing valid trace_id of root span to Sampler, and in accordance with how other languages implement.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes