-
Notifications
You must be signed in to change notification settings - Fork 774
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 context root to the front of the route in the span name #1418
Add context root to the front of the route in the span name #1418
Conversation
8d99287
to
319453f
Compare
|
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/BaseTracer.java
Outdated
Show resolved
Hide resolved
9ac0afc
to
a153af5
Compare
a153af5
to
8db6d34
Compare
See the updated the description for explanation of the different things in this PR. I can submit the commits one-by-one if that's preferred. |
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/BaseTracer.java
Outdated
Show resolved
Hide resolved
.../main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxRsAnnotationsTracer.java
Show resolved
Hide resolved
.../main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v2_0/JaxRsAnnotationsTracer.java
Outdated
Show resolved
Hide resolved
...a/io/opentelemetry/javaagent/instrumentation/spring/webflux/server/HandlerAdapterAdvice.java
Show resolved
Hide resolved
...rc/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcTracer.java
Outdated
Show resolved
Hide resolved
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/BaseTracer.java
Outdated
Show resolved
Hide resolved
.../io/opentelemetry/javaagent/instrumentation/spring/webflux/server/RouteOnSuccessOrError.java
Outdated
Show resolved
Hide resolved
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/BaseTracer.java
Outdated
Show resolved
Hide resolved
...vlet-2.2/src/main/java/io/opentelemetry/instrumentation/servlet/ServletHttpServerTracer.java
Show resolved
Hide resolved
.../main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxRsAnnotationsTracer.java
Outdated
Show resolved
Hide resolved
.../main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxRsAnnotationsTracer.java
Outdated
Show resolved
Hide resolved
.../main/java/io/opentelemetry/javaagent/instrumentation/jaxrs/v1_0/JaxRsAnnotationsTracer.java
Show resolved
Hide resolved
...rc/main/java/io/opentelemetry/javaagent/instrumentation/springwebmvc/SpringWebMvcTracer.java
Outdated
Show resolved
Hide resolved
Added note to description:
The tests may take some work, so would prefer to create separate issue to track. |
I'm not sure we can always get the servlet request statically (e.g. jersey). If we can't get the servlet context path everywhere, then I think probably better to use the Let me know your thoughts. |
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.
Had no idea I was using jetty, not jersey. Servlet's very complicated 😅
import io.opentelemetry.context.Context; | ||
import io.opentelemetry.context.ContextKey; | ||
|
||
public class ServletContextPath { |
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.
ServletContextContextUtils? Just kidding :)
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.
Let's add some class javadoc to explain what's going on, including why this needs to go in instrumentation-api
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.
👍 will do tomorrow before merging
Resolves #1299
This PR does a few things, please see commit breakout:
ApplicationFilterChain.doFilter
andHttpServlet.service
. Now it usesrequest.getServletPath()
for the span name instead.Currently missing tests for non-root context path in
jaxrs-1.0
webflux