Class ServletContextPath
java.lang.Object
io.opentelemetry.javaagent.bootstrap.servlet.ServletContextPath
The context key here is used to propagate the servlet context path throughout the request, so
that routing framework instrumentation that updates the span name with a more specific route can
prepend the servlet context path in front of that route.
This needs to be in the instrumentation-api module, instead of injected as a helper class into the different modules that need it, in order to make sure that there is only a single instance of the context key, since otherwise instrumentation across different class loaders would use different context keys and not be able to share the servlet context path.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST> io.opentelemetry.context.Contextinit(io.opentelemetry.context.Context context, Function<REQUEST, String> contextPathExtractor, REQUEST request) static StringReturns a concatenation of a servlet context path stored in the givencontextand a givenspanName.
-
Method Details
-
init
-
prepend
Returns a concatenation of a servlet context path stored in the givencontextand a givenspanName. If there is no servlet path stored in the context, returnsspanName.
-