Kafka instrumentation: make return type more general in instrumentation matching
MODIFY
dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaConsumerInstrumentation.java
dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaConsumerInstrumentation.java
package datadog.trace.instrumentation.kafka_clients;
+import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
import static datadog.trace.instrumentation.kafka_clients.KafkaDecorator.CONSUMER_DECORATE;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
@@ -55,7 +56,7 @@ public final class KafkaConsumerInstrumentation extends Instrumenter.Default {
.and(
takesArgument(0, String.class)
.or(takesArgument(0, named("org.apache.kafka.common.TopicPartition"))))
- .and(returns(Iterable.class)),
+ .and(returns(safeHasSuperType(named(Iterable.class.getName())))),
IterableAdvice.class.getName());
transformers.put(
isMethod()

Kafka instrumentation: make return type more general in instrumentation matching