-
Notifications
You must be signed in to change notification settings - Fork 624
Kafka ProducerRecord may end up with duplicated trace headers #3095
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
Comments
Can you, please, share with us what are those header values? |
An example would be (in the format of
So of course the trace ID is the same, but the span is different because one is from the outer Spring Integration span and the other one is from the Spring Kafka binder observation. |
Thanks for confirmation! Any chances that you can share with us a simple project we can reproduce and play with on our side? |
Yes exactly.
Yea that is also what I'm thinking.
I don't have any sample project at hand right now. But if you follow the reproduction steps it should be very easy to reproduce. |
OK. I'll try to make one myself:
And send message to the Kafka topic via Is that correct? |
Yep. |
So, I created a simple Spring Boot project for Kafka Binder.
It indeed fails like:
The first header is a result of observation on the Looking further for the place where we add extra one... |
So, in debug I see, that first The second one is created by the
So, look like Spring Kafka issue and Spring Cloud Stream is suffering here just with consequences of components involved. We cannot transfer issues between GitHub organization, so we would appreciate if you can created an issue in https://github.com/spring-projects/spring-kafka with a link to this one. Thank you! |
Sure will do, lets hope this doesn't result in a ping-pong of the issue between both projects. 😄 |
No, it won't. Because the one who takes care about that issue in Spring Kafka would be me 😉 |
Ha, great. 😄 |
Closed in favor of: spring-projects/spring-kafka#3786 |
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue
I found a bit of a weird behaviour when enabling the observation on Spring Integrations and the Spring Kafka binder.
In this case the Spring Integration already adds a
traceparent
header (e.g. when using W3C traces) to the internalMessage
but later on the Spring Kafka binder will also add anothertraceparent
header.To Reproduce
Steps to reproduce the behavior:
spring.integration.management.observation-patterns
spring.cloud.stream.kafka.binder.enable-observation
StreamBridge
traceparent
headersVersion of the framework
4.2.0
Expected behavior
There should be just one
traceparent
header on a produced record.Additional context
Even though it is already possible to handle that in a way by suppressing the header from the Spring Integration via
spring.cloud.stream.kafka.default.producer.header-patterns
it would be great to see a more permanent solution.I would suggest to either:
traceparent
headers to theBinderHeaderMapper
implementation (potentially also other headers would be needed then in case people use something different than W3C headers)KafkaRecordSenderContext
to first remove the same existing header and replacing it instead of just adding new onesThe text was updated successfully, but these errors were encountered: