-
Notifications
You must be signed in to change notification settings - Fork 19
Restore trace state back to cleared when wrapWithNewTrace is called with no trace state #52
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
Restore trace state back to cleared when wrapWithNewTrace is called with no trace state #52
Conversation
|
Proposed fix for #51 |
| return Preconditions.checkNotNull(currentTrace.get(), "There is no root span").getTraceId(); | ||
| } | ||
|
|
||
| /** Clears the current trace id and returns (a copy of) it if present */ |
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.
I don't think this makes a copy
fda93bc to
72ba144
Compare
| } | ||
|
|
||
| /** Clears the current trace id and returns it if present. */ | ||
| static Optional<Trace> getAndClearTraceIfPresent() { |
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.
I'd like if this was public, but we can look into that in a separate PR!
…ith no trace state.
72ba144 to
63b6ce5
Compare
carterkozak
left a comment
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.
Thanks!
Previously, when
Tracers::wrapWithNewTracewas called with no trace state, the trace state would incorrectly be restored to a new trace rather than the cleared state. Now, the trace state will be appropriately returned to the cleared state.