-
Notifications
You must be signed in to change notification settings - Fork 885
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
Add withParent option to annotation @WithSpan #13112
base: main
Are you sure you want to change the base?
Add withParent option to annotation @WithSpan #13112
Conversation
Signed-off-by: xiepuhuan <[email protected]>
The smoke test of grpc failed. Because I modified the |
You got it wrong. The test is failing because after your changes the instrumentation does not work any more for old version of the |
@laurit Thank you for your reply. I want to use reflection to determine whether the |
...ntation-annotations/src/main/java/io/opentelemetry/instrumentation/annotations/WithSpan.java
Outdated
Show resolved
Hide resolved
* <p>If set to {@code false}, the created span will use {@link Context#root()} as its parent, | ||
* starting a new, independent trace. | ||
*/ | ||
boolean withParent() default true; |
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 kind of like the name proposed in #5837: noParent()
at first I thought I liked something like newTrace()
, but concerned people will overuse it thinking that if they don't then it won't create a span if there's no existing trace
cc @open-telemetry/java-instrumentation-approvers any thoughts on naming?
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.
root()
or rootSpan()
?
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.
yeah, what I was trying to avoid is that people may think using root()
or rootSpan()
is the only way to create a root span, when creating a root span is already the default if there's not an existing parent span already
some other options...
withoutParent()
breakFromParent()
ignoreParent()
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.
another option
inheritContext() default true
which points to it being more than just lack of parent 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.
another option
inheritContext() default true
which points to it being more than just lack of parent span
I think this is good.
Related to #1036