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

RabbitMqSpanDecorator - Invalid Parent Span Id when EXCHANGE_NAME header not set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.4.0
    • 3.4.3, 3.5.0
    • camel-opentracing
    • None
    • Unknown

    Description

      It seems like there is no strict requirement for rabbitmq.EXCHANGE_NAME header to set by a producer e.g. the following code "works":

      from("direct:foo")
         .to("bar.exchange?queue=bar.queue&autoDelete=false")
         .end()
      

      However in this instance a span will be created with null as the operation name.

      Such spans will be ignored by the collector e.g. Jaeger, which results in subsequent spans having missing parents and "invalid parent span id" warnings appearing.

      Doing the following prevents this.

      from("direct:foo") 
        .setHeader("rabbitmq.EXCHANGE_NAME").simple("bar.exchange")
        .to("bar.exchange?queue=bar.queue&autoDelete=false")
        .end()
      

      It seems like we don't necessarily need the overridden getDestination method in the RabbitMqSpanDecorator and could fall through to the base implementation?

      Happy to raise a PR but thought I would collect thoughts in case I had missed some subtlety. 

       

       

       

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mcrmfc Matt Robbins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: