-
Notifications
You must be signed in to change notification settings - Fork 858
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
Remove a few ServerSpanNaming
usages
#4900
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
|
||
package io.opentelemetry.javaagent.instrumentation.jaxws.jws.v1_1; | ||
|
||
import static io.opentelemetry.instrumentation.api.servlet.ServerSpanNaming.Source.CONTROLLER; | ||
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed; | ||
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasSuperMethod; | ||
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.implementsInterface; | ||
|
@@ -20,12 +19,10 @@ | |
|
||
import io.opentelemetry.context.Context; | ||
import io.opentelemetry.context.Scope; | ||
import io.opentelemetry.instrumentation.api.servlet.ServerSpanNaming; | ||
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation; | ||
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer; | ||
import io.opentelemetry.javaagent.instrumentation.api.CallDepth; | ||
import io.opentelemetry.javaagent.instrumentation.jaxws.common.JaxWsRequest; | ||
import io.opentelemetry.javaagent.instrumentation.jaxws.common.JaxWsServerSpanNaming; | ||
import javax.jws.WebService; | ||
import net.bytebuddy.asm.Advice; | ||
import net.bytebuddy.description.type.TypeDescription; | ||
|
@@ -77,8 +74,6 @@ public static void startSpan( | |
|
||
Context parentContext = currentContext(); | ||
request = new JaxWsRequest(target.getClass(), methodName); | ||
ServerSpanNaming.updateServerSpanName( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would have been relevant only when request is handled by a jax-ws framework that we don't have integration with (or when framework instrumentation is disabled or when there is a bug that prevents it from working properly) because jax-ws framework instrumentation runs before it and already sets the name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep -- and it sets a |
||
parentContext, CONTROLLER, JaxWsServerSpanNaming.SERVER_SPAN_NAME, request); | ||
if (!instrumenter().shouldStart(parentContext, request)) { | ||
return; | ||
} | ||
|
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.
One problem with not using
ServerSpanNaming.updateServerSpanName
is that when there is an exception and request is dispatched to exception handling servlet it can overwrite the name set by the original request.ServerSpanNaming
avoided it by disallowing name update when new name had the same or lower priority as the name set.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 that really happen though? We don't really call
updateServerSpanName
at the end of processing; there's one invocation infinally
block inOpenTelemetryHandlerMappingFilter
in spring-webmvc, but it's a web controller framework - it won't run jax-ws code in a controller (probably).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.
In web.xml you can set error pages where container will dispatch when there is an exception or when request status is 500 or whatever. This error handler can be a servlet and could potentially also try to update server span name.
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.
True, that's a valid scenario. Hmm, is this behavior that important, should we keep it? Or would it be fine to just ignore that case (since it's just jax-ws; and maybe jax-ws has its own exception handler interface or something)
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 believe that for jax-ws it is ok to ignore it. It needs to send errors back as a soap response so it can't use servlet error handling.