-
Notifications
You must be signed in to change notification settings - Fork 782
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
New instrumentation for reactive kafka clients #2268
Conversation
@maciej-gromul Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@maciej-gromul can you please sign the CLA? |
Hello, i'm trying to settle some legal things on my side. I'm part of https://github.com/MaerskTech but i can't see it in CLA for choice, do you know what might i be missing ? |
Eeee no idea - can you check this out https://cla.pivotal.io/about ? |
Setting myself as public contributor within our org helped. Now i'm waiting for confirmation whether i can sign CLA :) Can you in the meantime take a look at spring-projects-experimental/spring-cloud-sleuth-otel#159 ? It's connected to this one as it brings brave and otel support to the same level in this case :) |
@maciej-gromul Thank you for signing the Contributor License Agreement! |
@marcingrzejszczak successfully signed ;) |
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.
I've added a couple of small remarks.
Apart from that I want to understand a few things before we proceed. So do I understand correctly that the current behavior immediately creates and closes the span? And your change now for each element in a flux will instrument the Reactor context with properly extracted span from the consumerRecord
?
Also I wonder about any breaking changes. I mean this seems like fixing a bug but I would like to ensure that we're not breaking anybody if we don't need to. I don't see any breaking changes at a first glance - do you?
...on/src/main/java/org/springframework/cloud/sleuth/instrument/kafka/TracingKafkaReceiver.java
Show resolved
Hide resolved
...on/src/main/java/org/springframework/cloud/sleuth/instrument/kafka/TracingKafkaReceiver.java
Show resolved
Hide resolved
...n/java/org/springframework/cloud/sleuth/instrument/kafka/ReactiveKafkaTracingPropagator.java
Outdated
Show resolved
Hide resolved
BTW have you seen this work here ? reactor/reactor-kafka#325 |
The only thing i can think of is the TracingKafkaConsumerFactory being removed and it's autoconfiguration for reactive consumers. We can leave TracingKafkaConsumerFactory as it is and it's bean autoconfiguration but then if someone has his own ConsumerFactory implementation registered as a bean it will get wrapped again leading to duplicated spans.
Haven't seen that one, seems to be for spring boot 3 with observations ? I've already sent and issue to reactor-core since there's propagation issue there reactor/reactor-core#3395 |
But nobody should directly use the
Correct. As for the other issue you're referring to I was debugging this partially with Darek today ;) |
Congrats @maciej-gromul on your PR! |
I can leave the class TracingKafkaConsumerFactory but to make it transparent i guess we would need to bring back in the TracingReactorKafkaAutoConfiguration the bean of TracingKafkaConsumerFactory. That way it would be transparent but im not 100% sure whether it wouldn't collide with new solution. Umm you've closed the task without that deprecation ? Will you bring that factory back in separate issue ? |
Oops, I've forgotten about that. Care to open another PR that will add the deprecation? I wouldn't add the bean back cause that bean is really internal to our instrumentation and can cause trouble. |
I've added separate PR here: #2272 |
Because current implementation created and closed spans immediately it was hard to follow the context. New implementation relies on reactor instrumentation to provide better experience where context contains tracing context and is being propagated downstream.