Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16921

KafkaSpanDecorator sometimes sets the wrong message_bus.destination tag value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.11.2, 3.12.0
    • camel-tracing
    • None
    • Unknown

    Description

      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.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            jamesnetherton James Netherton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: