You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
The trace ID changes unexpectedly across different Kafka producer and consumer operations. Below is a sample log output demonstrating the issue:
2025-01-05T19:23:49.726+01:00 INFO 72749 --- [sample-service] [nio-8080-exec-1] [4b7ede1e7858060aeac5ffec1685171d-b03b1a50e75f9d99] c.b.b.c.g.ConfigurationsService
2025-01-05T19:23:49.922+01:00 INFO 72749 --- [sample-service] [ntainer#0-0-C-1] [28838532a77fd955681f83fbb0171a6c-134cd44f90cdb7ee] c.b.c.c.ConfigurationsConsumer
Notice the trace IDs:
[4b7ede1e7858060aeac5ffec1685171d-49e46abd74e60589] during producer initialization.
[28838532a77fd955681f83fbb0171a6c-134cd44f90cdb7ee] during consumer message processing.
The trace IDs do not remain consistent for operations that should belong to the same trace.
To Reproduce
Enable tracing with the configuration shown above.
Perform a Kafka producer operation, followed by a consumer operation.
Observe the logs and note the changing trace IDs.
Expected behavior
The trace ID should remain the same throughout the lifecycle of a trace, including producer creation, message publishing, consumer message processing, and downstream operations.
The text was updated successfully, but these errors were encountered:
I think with 3.3.7 you mean Spring Boot version.
Spring for Apache Kafka for that one is 3.2.6.
I don't think the producer creating phase is supposed to be included into some trace.
Usually that happens during Spring application startup.
However, I agree that producing and consuming has to be maintain the same trace.
That's exactly the whole point of the distributed tracing.
Would be great if you could share with us a simple project where we can reproduce the problem.
In what version(s) of Spring for Apache Kafka are you seeing this issue?
"3.3.7"
Describe the bug
When enabling tracing in Spring Kafka using the following configuration:
spring:
kafka:
template:
observation-enabled: true
listener:
observation-enabled: true
the trace IDs are not being propagated.
Description
The trace ID changes unexpectedly across different Kafka producer and consumer operations. Below is a sample log output demonstrating the issue:
2025-01-05T19:23:49.726+01:00 INFO 72749 --- [sample-service] [nio-8080-exec-1] [4b7ede1e7858060aeac5ffec1685171d-b03b1a50e75f9d99] c.b.b.c.g.ConfigurationsService
2025-01-05T19:23:49.922+01:00 INFO 72749 --- [sample-service] [ntainer#0-0-C-1] [28838532a77fd955681f83fbb0171a6c-134cd44f90cdb7ee] c.b.c.c.ConfigurationsConsumer
Notice the trace IDs:
[4b7ede1e7858060aeac5ffec1685171d-49e46abd74e60589] during producer initialization.
[28838532a77fd955681f83fbb0171a6c-134cd44f90cdb7ee] during consumer message processing.
The trace IDs do not remain consistent for operations that should belong to the same trace.
To Reproduce
Enable tracing with the configuration shown above.
Perform a Kafka producer operation, followed by a consumer operation.
Observe the logs and note the changing trace IDs.
Expected behavior
The trace ID should remain the same throughout the lifecycle of a trace, including producer creation, message publishing, consumer message processing, and downstream operations.
The text was updated successfully, but these errors were encountered: