-
Notifications
You must be signed in to change notification settings - Fork 936
Issue 7869 - Support the new W3C random flag #8012
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
base: main
Are you sure you want to change the base?
Issue 7869 - Support the new W3C random flag #8012
Conversation
Adding a new bit definition to TraceFlags. Adding a method to IdGenerator to declare randomness of the generated trace-ids. Passing the correct TraceFlags to the configured sampler for root spans. Modifying and adding unit tests.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8012 +/- ##
============================================
- Coverage 90.15% 90.14% -0.01%
- Complexity 7476 7486 +10
============================================
Files 834 834
Lines 22540 22566 +26
Branches 2236 2238 +2
============================================
+ Hits 20320 20343 +23
- Misses 1515 1519 +4
+ Partials 705 704 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| * generated by a truly random Id generator, otherwise {@code false}. Providing default | ||
| * implementation just to maintain compatibility. | ||
| * | ||
| * @return {@code true} if the samplingrandomTraceId bit is on for this {@link TraceFlags}, |
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.
Is samplingrandomTraceId supposed to reference a constant?
| parentContextForSampler = | ||
| preparePrimordialContext( | ||
| parentContext, | ||
| TraceFlags.getDefault().withRandomTraceIdBit(), |
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.
Similar to this comment, we should use singletons here to avoid allocations on the hot path.
Ideally the entire primordial Span / SpanContext would be singletons.
|
@carlosalberto if you're more in the loop on level 2 span context, any chance you could give this a look over as a sanity check? |
| } | ||
|
|
||
| /** | ||
| * Returns a new instance of {@link TraceFlags} whose value is the result of a bitwise OR between |
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: new may imply object construction. Same advice applies to withSampledBit javadoc.
| * Returns a new instance of {@link TraceFlags} whose value is the result of a bitwise OR between | |
| * Returns an instance of {@link TraceFlags} whose value is the result of a bitwise OR between |
Adding a new bit definition to TraceFlags.
Adding a method to IdGenerator to declare randomness of the generated trace-ids. Passing the correct TraceFlags to the configured sampler for root spans. Modifying and adding unit tests.