-
Notifications
You must be signed in to change notification settings - Fork 860
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
Add support for Kafka consumer and producer interceptors. #4065
Conversation
|
This EasyCLA doesn't work ... it's generating forever ... |
hey @alesj, give it another try tomorrow, hopefully it was just having temporary problems, if not, post a screenshot and we can reach out to the EasyCLA team |
@trask OK, it works now ... signed |
Uh, any (better) idea what went wrong here? |
@alesj try running |
@laurit ah, OK, tnx ... fixed now |
c65ec26
to
08f72be
Compare
@alesj latest failure is just formatting. running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @alesj ,
Please take a look at the our Instrumenter API (posted a link to the class and some examples in one comment) - in general we want all our instrumentations to use it to generate telemetry (although there are still some that we haven't refactored yet).
...nts-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafka/TracingKafkaUtils.java
Outdated
Show resolved
Hide resolved
...-0.11/library/src/test/groovy/io/opentelemetry/instrumentation/kafka/InterceptorsTest.groovy
Outdated
Show resolved
Hide resolved
....11/library/src/main/java/io/opentelemetry/instrumentation/kafka/ClientSpanNameProvider.java
Outdated
Show resolved
Hide resolved
@mateuszrzeszutek OK, moved my stuff to |
Uh merge conflicts ... fixing ... |
49c2070
to
170837c
Compare
instrumentation/kafka-clients/kafka-clients-0.11/library/build.gradle.kts
Outdated
Show resolved
Hide resolved
...brary/src/main/java/io/opentelemetry/instrumentation/kafkaclients/StandardSpanDecorator.java
Outdated
Show resolved
Hide resolved
...-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/SpanDecorator.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumerInterceptor.java
Outdated
Show resolved
Hide resolved
...1/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingKafkaUtils.java
Outdated
Show resolved
Hide resolved
...-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/KafkaHeadersGetter.java
Show resolved
Hide resolved
...nts-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/KafkaSingletons.java
Outdated
Show resolved
Hide resolved
@mateuszrzeszutek @trask any idea how to limit logging in the test? |
...t/src/main/java/io/opentelemetry/javaagent/instrumentation/kafkaclients/KafkaSingletons.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
...library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java
Outdated
Show resolved
Hide resolved
...library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java
Outdated
Show resolved
Hide resolved
instrumentation/kafka-clients/kafka-clients-0.11/library/src/test/resources/log4j.properties
Outdated
Show resolved
Hide resolved
...ain/java/io/opentelemetry/javaagent/instrumentation/kafkastreams/KafkaStreamsSingletons.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumerInterceptor.java
Outdated
Show resolved
Hide resolved
40dcf49
to
78c75b7
Compare
...-clients-common/library/src/main/java/io/opentelemetry/instrumentation/kafka/KafkaUtils.java
Outdated
Show resolved
Hide resolved
...n/groovy/io/opentelemetry/instrumentation/kafkaclients/KafkaClientPropagationBaseTest.groovy
Show resolved
Hide resolved
.../library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingHolder.java
Outdated
Show resolved
Hide resolved
...library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
4b56eb2
to
f3574a4
Compare
@mateuszrzeszutek @trask i've added producer / consumer tracing wrappers to this PR ... let me know what you think |
...s-0.11/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Outdated
Show resolved
Hide resolved
.../library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingHolder.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumerInterceptor.java
Outdated
Show resolved
Hide resolved
instrumentation/kafka-clients/kafka-clients-0.11/library/build.gradle.kts
Outdated
Show resolved
Hide resolved
...library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java
Outdated
Show resolved
Hide resolved
...2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingConsumer.java
Outdated
Show resolved
Hide resolved
...2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/TracingProducer.java
Outdated
Show resolved
Hide resolved
...library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracingBuilder.java
Outdated
Show resolved
Hide resolved
...ts-2.6/library/src/main/java/io/opentelemetry/instrumentation/kafkaclients/KafkaTracing.java
Show resolved
Hide resolved
thanks @alesj! can you go through and mark conversations resolved where applicable, and make a list of any open questions that were raised either by reviewers or by yourself? then we'll go ahead and merge and we can create a tracking issue for the open questions / follow-ups (if any) that anyone can take |
OK, all conversations resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @alesj, kafka library instrumentation is a great addition to the project! and thanks for your patience with the reviews and merge conflicts! I will merge shortly 🎉
Thanks @alesj! 🚀 |
Hi folks, we were looking to add instrumentation for our kafka apps and not able to find any documentation how to do that using opentelemetry-java-instrumentation javaagent. I stumbled upon this commit, which looks like came jit for us :). Can you guys help with how do we use this feature. We have all of kafka consumer, producer and streaming clients in our code and need to instrument all of these. |
hey @rahja!
if you want to use the javaagent, you can follow the getting started instructions and it should automatically instrument kafka for you. this PR is about using kafka instrumentation without the javaagent |
Hi @trask, thanks for your response. We did follow getting started document and started getting all the traces, though producer and consumer traces don't get connected with each other. Link between them is getting broken somewhere, looks like parent trace-ids are not being sent from producer to consumer. Any suggestions on how to make that work? it will be very helpful if you can point me to right support channel or document for this. Appreciate you response. |
Hey @rahja , |
Sending a PR after a short discussion #4061
The goal is to have an equivalent interceptors implementation to this one:
The main stuff is in TracingKafkaUtils class.
I'm not 100% I got all of the things, specially scopes and contexts right,
so a more experienced eye is welcome.
Plus some suggestions on what to check in the test(s) -- currently I just print out headers.