-
Notifications
You must be signed in to change notification settings - Fork 868
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
stabilise spanNames #12487
base: main
Are you sure you want to change the base?
stabilise spanNames #12487
Conversation
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.
It looks good! But I am curious about if there are any other documents or discussions to support this migration apart from quarkusio/quarkus#41521 (comment)? Because I am not sure whether other classes in instrumentation-api-incubator
exist similar problem. @trask
...mentation-api/src/main/java/io/opentelemetry/instrumentation/api/semconv/util/SpanNames.java
Outdated
Show resolved
Hide resolved
...tor/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/util/SpanNames.java
Show resolved
Hide resolved
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.
@open-telemetry/java-instrumentation-approvers @jack-berg @brunobat any thoughts about committing to this as a stable API? thanks
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.
Looks good. Thanks!
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.
Seems ok to me. One day we could end up with semantic conventions for these types of situations, but: 1. I think this is a good way to name spans which will be highly defensible. 2. This is just a utility method.
...tor/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/util/SpanNames.java
Show resolved
Hide resolved
Map<String, String> spanNameCache = | ||
spanNameCaches.computeIfAbsent(clazz, c -> new ConcurrentHashMap<>()); | ||
|
||
// not using computeIfAbsent, because it would require a capturing (allocating) lambda |
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.
That shouldn't be the case if you use a method reference.
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'm not sure how you would use a method reference here?
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
public final class SpanNames { |
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.
Javadoc?
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.
This seems fine to me. I think Jack's point about delegating to the stable class should be addressed, and I was surprised to learn that there weren't any unit tests on this very testable code. 😭
# Conflicts: # docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt
@breedx-splk done |
@trask @jack-berg @breedx-splk I have fixed the above problems, please help me review it, Thank you. |
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 @AlchemyDing!
resolve issue
move
SpanNames
frominstrumentation-api-incubator
toinstrumentation-api