We're using the ElasticApmAttacher to collect data from our Java services, while most of our services are using Go. All our services communicate via Kafka messages.
The java services seem to fail to extract the traceparent
header from our messages, as they start a new trace every time. I have verified that the Go services are properly setting the text header.
While scanning scanning the code for the kafka plugin, I stumbled upon KafkaRecordHeaderAccessor, which (to my fairly limited understanding) only seems to support the binary format for the header. As we're using the text representation, I could see this as the root for our problem. Is that an actual limitation of the Kafka plugin? If so, is there a reason for it? Or am I misunderstanding the code?
(I didn't want to open up a bug at the repo because I'm not sure if it is a bug or if I'm mistaken )
APM Agent language and version:
Java, 1.35.0
Original install method (e.g. download page, yum, deb, from source, etc.) and version:
N/A
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
Steps to reproduce:
- Have a Go service instrumented using
go.opentelemetry.io/otel
(with kafka instrumentation provided bygo.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama
) - Have a Java services instrumented using
co.elastic.apm:apm-agent-attach:1.35.0
- Send a kafka message from the Go service to the Java service
- Java service opens a new trace instead of connecting to the previous trace