-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Kafka ProducerRecord may end up with duplicated trace headers #3786
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
Milestone
Comments
let me know if you'd like to discuss this. |
sobychacko
added a commit
to sobychacko/spring-kafka
that referenced
this issue
Mar 13, 2025
…header Fixes: spring-projects#3786 Issue link: spring-projects#3786 When tracing is enabled, the KafkaRecordSenderContext was adding a new traceparent header without removing existing ones, resulting in multiple traceparent headers in the same record. This commit fixes the issue by Updating KafkaRecordSenderContext to remove existing traceparent headers before adding new ones. **Auto-cherry-pick to `3.3.x` & `3.2.x`** Signed-off-by: Soby Chacko <[email protected]>
artembilan
pushed a commit
that referenced
this issue
Mar 14, 2025
Fixes: #3786 Issue link: #3786 When tracing is enabled, the KafkaRecordSenderContext was adding a new trace header without removing existing ones, resulting in multiple headers in the same record. This commit fixes the issue by Updating KafkaRecordSenderContext to remove existing trace headers before adding new ones. **Auto-cherry-pick to `3.2.x`** # Conflicts: # spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationTests.java
artembilan
pushed a commit
that referenced
this issue
Mar 14, 2025
Fixes: #3786 Issue link: #3786 When tracing is enabled, the KafkaRecordSenderContext was adding a new trace header without removing existing ones, resulting in multiple headers in the same record. This commit fixes the issue by Updating KafkaRecordSenderContext to remove existing trace headers before adding new ones. # Conflicts: # spring-kafka/src/test/java/org/springframework/kafka/support/micrometer/ObservationTests.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.2.* up to the latest 3.3.*
Describe the bug
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
headersExpected behavior
There should be just one
traceparent
header on a produced record.Sample
see spring-cloud/spring-cloud-stream#3095 (comment)
Additional info
This issue originates from spring-cloud/spring-cloud-stream#3095 but it was suggested in the issue over there that the underlying problem should be fixed in the Spring Kafka library instead.
The text was updated successfully, but these errors were encountered: