-
Notifications
You must be signed in to change notification settings - Fork 47
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
Use CurrentTraceContext for OTel's Tracer bridge #310
Conversation
without this commit we're not using the whole mechanism of merging scopes, baggages and checking for noops that is inbuilt in CurrentTraceContext when calling tracer.withSpan in OTel with this commit we're redirecting the calls to CurrentTraceContext fixes gh-215
🛠 Lift Auto-fixSome of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1 # Download the patch
curl https://lift.sonatype.com/api/patch/github.com/micrometer-metrics/tracing/310.diff -o lift-autofixes.diff
# Apply the patch with git
git apply lift-autofixes.diff
# Review the changes
git diff Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command: curl https://lift.sonatype.com/api/patch/github.com/micrometer-metrics/tracing/310.diff | git apply Once you're satisfied, commit and push your changes in your project. Footnotes |
final OtelTraceContext otelTraceContext; | ||
|
||
final Context old; |
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.
What do you think about renaming them to currentOtelTraceContext
and oldContext
?
@@ -57,6 +57,9 @@ static io.opentelemetry.api.trace.Span toOtel(Span span) { | |||
} | |||
|
|||
static Span fromOtel(io.opentelemetry.api.trace.Span span) { | |||
if (span instanceof OtelSpan) { | |||
return (OtelSpan) 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.
Does this cast have any effect when the return type is Span
anyways?
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.
Nope
654e147
to
cdab30b
Compare
cdab30b
to
c882954
Compare
without this commit we're not using the whole mechanism of merging scopes, baggages and checking for noops that is inbuilt in CurrentTraceContext when calling tracer.withSpan in OTel with this commit we're redirecting the calls to CurrentTraceContext
fixes gh-215