James Netherton created CAMEL-16921:
---------------------------------------
Summary: KafkaSpanDecorator sometimes sets the wrong
message_bus.destination tag value
Key: CAMEL-16921
URL: https://issues.apache.org/jira/browse/CAMEL-16921
Project: Camel
Issue Type: Bug
Components: camel-tracing
Reporter: James Netherton
Consider a route like:
from("kafka:foo")
.to("kafka:bar")
When you view the trace span for the producer, the message_bus.destination tag
contains "foo". I'd expect it to be "bar" (as that's what we are producing to).
The logic to determine the destination can probably be improved a bit:
https://github.com/apache/camel/blob/main/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/KafkaSpanDecorator.java#L52-L59
It looks up an exchange header "kafka.TOPIC". The problem in this particular
scenario is that there will be a value present in the exchange passed from the
"kafka:foo" consumer. The Kafka header filter will have not yet stripped it
when the tracing EventNotifier bits run, so an incorrect value is used for the
span name & tag.
Maybe it could always look up the topic name from the endpoint URI options
instead of relying on the header.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)