Skip to content
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

Instrumentation not working with kafka stream version above 2.6 #3436

Closed
GuillaumeWaignier opened this issue Jun 29, 2021 · 0 comments · Fixed by #3438
Closed

Instrumentation not working with kafka stream version above 2.6 #3436

GuillaumeWaignier opened this issue Jun 29, 2021 · 0 comments · Fixed by #3438
Labels
bug Something isn't working repro provided

Comments

@GuillaumeWaignier
Copy link
Contributor

Describe the bug

Opentelemetry-java-instrumentation does not instrument the code when the version of kafka stream is above 2.6.0. (It is working with version 2.5.0 and below).

With version 2.5.0, there are spans with otel.library.name = io.opentelemetry.javaagent.kafka-streams-0.11 whereas they are no spans with version 2.6.0.

Steps to reproduce

I have created a sample project to reproduce the problem.
https://github.com/GuillaumeWaignier/kafka-apm-example#test-with-a-statefull-join-kstream

It is a simple join between 2 topics test1 and test2.
There are two processes (kstream-statefullJoin-2-5 and kstream-statefullJoin-2-6) in order to compare the behavior between the versions 2.5 and 2.6.
image

We can see the traces inside the kaka stream when the version 2.5.0.
However, with the version 2.6.0, there are only the consume trace created by the io.opentelemetry.javaagent.kafka-clients-0.11

What version are you using?
The version 1.2.0 was used.

Additional context
Accordingly to the start instrumentation code, the kafka-stream instrumentation relies on the method nextRecord of class org.apache.kafka.streams.processor.internals.PartitionGroup.

Between the version 2.5 and 2.6 of the kafka stream library, the method's signature was changed:

  • from: StampedRecord nextRecord(final RecordInfo info)
  • to : StampedRecord nextRecord(final RecordInfo info, final long wallClockTime)

Accordingly to the stop instrumentation code, the kafka-stream instrumentation relies on the method process of class org.apache.kafka.streams.processor.internals.StreamTask.

Between the version 2.5 and 2.6 of the kafka stream library, the method's signature was changed:

  • from: public boolean process()
  • to : public boolean process(final long wallClockTime)

Proposed solution

I have removed the constraints in the stop instrumentation code in order to match the method process independently of the number of parameters.

The code is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repro provided
Projects
None yet
2 participants