Rename class since they instrument the context
RENAME
dd-java-agent/instrumentation/jax-rs-annotations-2/filter-jersey/src/main/java/datadog/trace/instrumentation/jaxrs2/JerseyRequestFilterInstrumentation.java
dd-java-agent/instrumentation/jax-rs-annotations-2/filter-jersey/src/main/java/datadog/trace/instrumentation/jaxrs2/JerseyRequestContextInstrumentation.java
@@ -11,7 +11,7 @@ import net.bytebuddy.asm.Advice;
/** Jersey specific filter instrumentation. */
@AutoService(Instrumenter.class)
-public class JerseyRequestFilterInstrumentation extends AbstractRequestFilterInstrumentation {
+public class JerseyRequestContextInstrumentation extends AbstractRequestContextInstrumentation {
public static class ContainerRequestContextAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
public static AgentScope decorateAbortSpan(@Advice.This final ContainerRequestContext context) {

RENAME
dd-java-agent/instrumentation/jax-rs-annotations-2/filter-resteasy-3.0/src/main/java/datadog/trace/instrumentation/jaxrs2/Resteasy30RequestFilterInstrumentation.java
dd-java-agent/instrumentation/jax-rs-annotations-2/filter-resteasy-3.0/src/main/java/datadog/trace/instrumentation/jaxrs2/Resteasy30RequestContextInstrumentation.java
@@ -10,7 +10,7 @@ import org.jboss.resteasy.core.ResourceMethodInvoker;
import org.jboss.resteasy.core.interception.PostMatchContainerRequestContext;
@AutoService(Instrumenter.class)
-public class Resteasy30RequestFilterInstrumentation extends AbstractRequestFilterInstrumentation {
+public class Resteasy30RequestContextInstrumentation extends AbstractRequestContextInstrumentation {
public static class ContainerRequestContextAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)

RENAME
dd-java-agent/instrumentation/jax-rs-annotations-2/filter-resteasy-3.1/src/main/java/datadog/trace/instrumentation/jaxrs2/Resteasy31RequestFilterInstrumentation.java
dd-java-agent/instrumentation/jax-rs-annotations-2/filter-resteasy-3.1/src/main/java/datadog/trace/instrumentation/jaxrs2/Resteasy31RequestContextInstrumentation.java
@@ -10,7 +10,7 @@ import org.jboss.resteasy.core.ResourceMethodInvoker;
import org.jboss.resteasy.core.interception.jaxrs.PostMatchContainerRequestContext;
@AutoService(Instrumenter.class)
-public class Resteasy31RequestFilterInstrumentation extends AbstractRequestFilterInstrumentation {
+public class Resteasy31RequestContextInstrumentation extends AbstractRequestContextInstrumentation {
public static class ContainerRequestContextAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
public static AgentScope decorateAbortSpan(@Advice.This final ContainerRequestContext context) {

RENAME
dd-java-agent/instrumentation/jax-rs-annotations-2/src/main/java/datadog/trace/instrumentation/jaxrs2/AbstractRequestFilterInstrumentation.java
dd-java-agent/instrumentation/jax-rs-annotations-2/src/main/java/datadog/trace/instrumentation/jaxrs2/AbstractRequestContextInstrumentation.java
@@ -23,8 +23,8 @@ import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
-public abstract class AbstractRequestFilterInstrumentation extends Instrumenter.Default {
- public AbstractRequestFilterInstrumentation() {
+public abstract class AbstractRequestContextInstrumentation extends Instrumenter.Default {
+ public AbstractRequestContextInstrumentation() {
super("jax-rs", "jaxrs", "jax-rs-filter");
}
@@ -41,7 +41,7 @@ public abstract class AbstractRequestFilterInstrumentation extends Instrumenter.
"datadog.trace.agent.tooling.ClassHierarchyIterable",
"datadog.trace.agent.tooling.ClassHierarchyIterable$ClassIterator",
packageName + ".JaxRsAnnotationsDecorator",
- AbstractRequestFilterInstrumentation.class.getName() + "$RequestFilterHelper",
+ AbstractRequestContextInstrumentation.class.getName() + "$RequestFilterHelper",
};
}

RENAME
dd-java-agent/instrumentation/jax-rs-annotations-2/src/main/java/datadog/trace/instrumentation/jaxrs2/ContainerRequestContextInstrumentation.java
dd-java-agent/instrumentation/jax-rs-annotations-2/src/main/java/datadog/trace/instrumentation/jaxrs2/DefaultRequestContextInstrumentation.java
package datadog.trace.instrumentation.jaxrs2;
-import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static datadog.trace.instrumentation.api.AgentTracer.activateSpan;
import static datadog.trace.instrumentation.api.AgentTracer.activeSpan;
import static datadog.trace.instrumentation.api.AgentTracer.startSpan;
import static datadog.trace.instrumentation.jaxrs2.JaxRsAnnotationsDecorator.DECORATE;
-import static java.util.Collections.singletonMap;
-import static net.bytebuddy.matcher.ElementMatchers.isInterface;
-import static net.bytebuddy.matcher.ElementMatchers.isMethod;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
-import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.instrumentation.api.AgentScope;
import datadog.trace.instrumentation.api.AgentSpan;
import java.lang.reflect.Method;
-import java.util.Map;
import javax.ws.rs.container.ContainerRequestContext;
import net.bytebuddy.asm.Advice;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
/**
* Create a generic jax-rs.request.abort span based on the class name of the filter Implementation
* specifc instrumentations can override tag values
*/
@AutoService(Instrumenter.class)
-public class ContainerRequestContextInstrumentation extends Instrumenter.Default {
- public ContainerRequestContextInstrumentation() {
- super("jax-rs", "jaxrs", "jax-rs-filter");
- }
-
- @Override
- public ElementMatcher<TypeDescription> typeMatcher() {
- return not(isInterface())
- .and(safeHasSuperType(named("javax.ws.rs.container.ContainerRequestContext")));
- }
-
- @Override
- public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
- return singletonMap(
- isMethod()
- .and(named("abortWith"))
- .and(takesArguments(1))
- .and(takesArgument(0, named("javax.ws.rs.core.Response"))),
- ContainerRequestContextInstrumentation.class.getName() + "$ContainerRequestContextAdvice");
- }
-
- @Override
- public String[] helperClassNames() {
- return new String[] {
- "datadog.trace.agent.decorator.BaseDecorator",
- "datadog.trace.agent.tooling.ClassHierarchyIterable",
- "datadog.trace.agent.tooling.ClassHierarchyIterable$ClassIterator",
- "datadog.trace.instrumentation.jaxrs2.JaxRsAnnotationsDecorator",
- };
- }
-
+public class DefaultRequestContextInstrumentation extends AbstractRequestContextInstrumentation {
public static class ContainerRequestContextAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
public static AgentScope createGenericSpan(@Advice.This final ContainerRequestContext context) {

Rename class since they instrument the context