diff --git a/dd-java-agent/instrumentation/kafka-streams-0.11/src/main/java/datadog/trace/instrumentation/kafka_streams/KafkaStreamsProcessorInstrumentation.java b/dd-java-agent/instrumentation/kafka-streams-0.11/src/main/java/datadog/trace/instrumentation/kafka_streams/KafkaStreamsProcessorInstrumentation.java index 1f4edb69a31..140acccfc7d 100644 --- a/dd-java-agent/instrumentation/kafka-streams-0.11/src/main/java/datadog/trace/instrumentation/kafka_streams/KafkaStreamsProcessorInstrumentation.java +++ b/dd-java-agent/instrumentation/kafka-streams-0.11/src/main/java/datadog/trace/instrumentation/kafka_streams/KafkaStreamsProcessorInstrumentation.java @@ -13,6 +13,8 @@ import static net.bytebuddy.matcher.ElementMatchers.isPackagePrivate; import static net.bytebuddy.matcher.ElementMatchers.isPublic; import static net.bytebuddy.matcher.ElementMatchers.returns; +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; @@ -102,7 +104,11 @@ public String[] helperClassNames() { @Override public void adviceTransformations(AdviceTransformation transformation) { transformation.applyAdvice( - isMethod().and(isPublic()).and(named("process")), + isMethod() + .and(isPublic()) + .and(named("process")) + // Method signature changed in 2.6. + .and(takesArguments(0).or(takesArguments(1).and(takesArgument(0, long.class)))), StopInstrumentation.class.getName() + "$StopSpanAdvice"); }