-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TracingConsumer
related exception due to missing currentLag
method with Kafka greater than or equal 3.0.0
#6432
Comments
hi @ppatierno! check out https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/VERSIONING.md#dropping-support-for-older-library-versions tl;dr, updating the library instrumentation "min version" to 3.0.0 seems reasonable to me. in general we wouldn't update all the way to 3.2.0 unless that is necessary (the library instrumentation doesn't pull in the library transitively, so it's not like the library instrumentation is pulling in an old version of the library) |
Thanks @trask ... so AFAIU, we can "easily" bump to 3.0.0 and fix the |
We could replace |
I think this is a pretty good idea. In the end, the We could use the same approach for the |
@ppatierno should be available in latest snapshot https://oss.sonatype.org/content/repositories/snapshots/io/opentelemetry/javaagent/opentelemetry-javaagent/1.17.0-SNAPSHOT/ Current plan is to release next week. |
I used the snapshot and the bug was fixed ;-) |
I am using the kafka-clients-2.6 instrumentation library in a Kafka Streams API based application which is using the
org.apache.kafka:kafka-streams:3.2.0
dependency.In order to wrap the consumer and producer that are used internally by such an application, the way is to develop a class implementing the
KafkaClientSupplier
interface.For example, the class implementing the
KafkaClientSupplier
interface is wrapping a Kafka consumer in the following way:Anyway, when running such an application, it throws the following exception:
The problem is related to the Kafka 2.6 version which is used in the Java instrumentation library.
Starting from Kafka 3.0.0, the
Consumer
interface has a newOptionalLong currentLag(TopicPartition topicPartition);
method which is, of course, not implemented by the currentTracingConsumer
(because based on Kafka 2.6 which doesn't have such a method).For this reason, instrumenting a Kafka Streams API based application using since Kafka 3.0.0 doesn't work anymore.
The instrumentation library should be upgraded to use Kafka 3.0.0 (even if I would upgrade to the latest 3.2.0) and implementing the missing method.
The text was updated successfully, but these errors were encountered: