|
@@ -5,10 +5,9 @@
|
|
|
|
|
|
package io.opentelemetry.javaagent.instrumentation.jaxrs.v2_0;
|
|
|
|
|
|
-import static io.opentelemetry.javaagent.instrumentation.jaxrs.v2_0.JaxrsSingletons.instrumenter;
|
|
|
-
|
|
|
import io.opentelemetry.api.trace.Span;
|
|
|
import io.opentelemetry.context.Context;
|
|
|
+import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
|
|
|
import io.opentelemetry.instrumentation.api.instrumenter.LocalRootSpan;
|
|
|
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpRouteHolder;
|
|
|
import io.opentelemetry.instrumentation.api.instrumenter.http.HttpRouteSource;
|
|
@@ -17,13 +16,15 @@ import javax.ws.rs.container.ContainerRequestContext;
|
|
|
|
|
|
public final class RequestContextHelper {
|
|
|
public static Context createOrUpdateAbortSpan(
|
|
|
- ContainerRequestContext requestContext, HandlerData handlerData) {
|
|
|
+ Instrumenter<HandlerData, Void> instrumenter,
|
|
|
+ ContainerRequestContext requestContext,
|
|
|
+ HandlerData handlerData) {
|
|
|
|
|
|
if (handlerData == null) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- requestContext.setProperty(JaxrsSingletons.ABORT_HANDLED, true);
|
|
|
+ requestContext.setProperty(JaxrsConstants.ABORT_HANDLED, true);
|
|
|
Context parentContext = Java8BytecodeBridge.currentContext();
|
|
|
Span serverSpan = LocalRootSpan.fromContextOrNull(parentContext);
|
|
|
Span currentSpan = Java8BytecodeBridge.spanFromContext(parentContext);
|
|
@@ -40,11 +41,11 @@ public final class RequestContextHelper {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- if (!instrumenter().shouldStart(parentContext, handlerData)) {
|
|
|
+ if (!instrumenter.shouldStart(parentContext, handlerData)) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- return instrumenter().start(parentContext, handlerData);
|
|
|
+ return instrumenter.start(parentContext, handlerData);
|
|
|
}
|
|
|
|
|
|
private RequestContextHelper() {}
|