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

Camel-opentelemetry: Avoid using the GlobalOpenTelemetry.get() and allow for injection of ContextPropagators

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0-M1
    • 4.0-M2, 4.0.0
    • None
    • None
    • Unknown

    Description

      A problem occures when using opentelemetry 4.0.0-M1 with spring-boot auto configuration.

      The autoconfiguration works as expected and the resulting openTelemetry bean is as expected.
      But when the first request comes in, the autoconfigured bean is not used and another openTelemetry configured with OpenTelemetry.noop() is used.

      org.apache.camel.opentelemetry.OpenTelemetryTracer#startExchangeBeginSpan uses GlobalOpenTelemetry.get(), which in turn looks into it's io.opentelemetry.api.GlobalOpenTelemetry#globalOpenTelemetry which was not set and so it creates the noop implementation.

      First step to fix without side effects is to allow the explicit setting of the ContextPropagators which then can be used by org.apache.camel.opentelemetry.starter.OpenTelemetryAutoConfiguration#openTelemetryEventNotifier to use the proper autoconfigured instances.

      https://camel.zulipchat.com/#narrow/stream/257301-camel-spring-boot/topic/opentelemetry/near/327478493

      Attachments

        Activity

          People

            Unassigned Unassigned
            acosentino Andrea Cosentino
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: