brave: Kafka Streams instrumentation not compatible with kafka-streams 3.0.0

Describe the Bug

A detailed description of this bug can be found on Stackoverflow: https://stackoverflow.com/questions/70382128/tracingkafkaclientsupplier-error-implementations-of-kafkaclientsupplier-should

Steps to Reproduce

Create a Spring Boot 2.6.1 application with Spring Cloud 2021.0.0, adding spring-cloud-sleuth to instrument it.

Expected Behaviour

The application should be instrumented correctly, not crashing at startup.

TracingKafkaClientSupplier should override this method from KafkaClientSupplier:

default Admin getAdmin(final Map<String, Object> config) {
        throw new UnsupportedOperationException("Implementations of KafkaClientSupplier should implement the getAdmin() method.");
}

However the current implementation returns AdminClient instead of Admin, thus, throwing the default method exception:

@Override public AdminClient getAdminClient(Map<String, Object> config) {
        return AdminClient.create(config);
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 19 (8 by maintainers)

Most upvoted comments

@TYsewyn and @jeqo Could you move #1320 (with any dependencies) forward?

Currently dealing with:

java.lang.AbstractMethodError: Receiver class brave.kafka.clients.TracingConsumer does not define or inherit an implementation of the resolved method 'abstract java.util.OptionalLong currentLag(org.apache.kafka.common.TopicPartition)' of interface org.apache.kafka.clients.consumer.Consumer. at org.apache.kafka.streams.processor.internals.PartitionGroup.readyToProcess(PartitionGroup.java:143) at org.apache.kafka.streams.processor.internals.StreamTask.isProcessable(StreamTask.java:674) at org.apache.kafka.streams.processor.internals.StreamTask.process(StreamTask.java:694) at org.apache.kafka.streams.processor.internals.TaskManager.process(TaskManager.java:1193) at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:753) at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:583) at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:555)

@jeqo I’m using 5.13.8, but I still have the same issue.

java.lang.AbstractMethodError: Receiver class brave.kafka.clients.TracingConsumer does not define or inherit an implementation of the resolved method 'abstract java.util.OptionalLong currentLag(org.apache.kafka.common.TopicPartition)' of interface org.apache.kafka.clients.consumer.Consumer.

The code base https://github.com/openzipkin/brave/blob/master/instrumentation/kafka-clients/src/main/java/brave/kafka/clients/TracingConsumer.java does not have the changes needed to resolve the issue as the PR #1320 was not merged

Is there any workaround? or am I missing something?

I am using Spring Boot 2.6 and spring-cloud-sleuth version 3.1.1 which seems to using 5.13.7 version of io.zipkin.brave

I have overridden now to use latest version of 5.13.8 of io.zipkin.brave

Issue resolved by using 5.13.8 version of brave-instrumentation-kafka-clients <dependency> <groupId>io.zipkin.brave</groupId> <artifactId>brave-instrumentation-kafka-clients</artifactId> <version>5.13.8</version> </dependency>

@jeqo I’m using 5.13.8, <dependency> <groupId>io.zipkin.brave</groupId> <artifactId>brave</artifactId> <version>5.13.8</version> </dependency> but I still have the same issue.

java.lang.AbstractMethodError: Receiver class brave.kafka.clients.TracingConsumer does not define or inherit an implementation of the resolved method 'abstract java.util.OptionalLong currentLag(org.apache.kafka.common.TopicPartition)' of interface org.apache.kafka.clients.consumer.Consumer.

The code base https://github.com/openzipkin/brave/blob/master/instrumentation/kafka-clients/src/main/java/brave/kafka/clients/TracingConsumer.java does not have the changes needed to resolve the issue as the PR https://github.com/openzipkin/brave/pull/1320 was not merged

Is there any workaround? or am I missing something?

I am using Spring Boot 2.6 and spring-cloud-sleuth version 3.1.1 which seems to using 5.13.7 version of io.zipkin.brave

I have overridden now to use latest version of 5.13.8 of io.zipkin.brave