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

camel-opentelemetry - OpenTelemetryTracingStrategy does not propagate OpenTelemetry Context in some cases

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.5.0
    • 4.6.0
    • camel-opentelemetry
    • None
    • Unknown

    Description

      When the excludePatterns is set in some cases, our OpenTelemetryTracingStrategy does not propagate the OpenTelemetry Context. Having the current Context correctly set enables users to use the `io.opentelemetry.instrumentation.annotations.@WithSpan` annotation to create custom Spans. This is particularly useful when the user wants to create a Span only for a particular method within the Process even though it's disabled e.g:

       

            openTelemetryTracingStrategy.setExcludePatterns("longRunningProcess")
             ...
      
             .process(exchange -> {
                    // No Span created by Camel because excluded 
                     longRunningProcess();
              }).id("longRunningProcess")
      
              ...
      
             private void longRunningProcess() {
                  // no Span
                  firstMethod();
                  // custom Span
                  secondMethod();
             }
             private void firstMethod() {
                      // no Span
             }
             @WithSpan        
             private void secondMethod() {
                      // no Span
             } 
      

      It would be nice to add an option in OpenTelemetryTracingStrategy to propagate the OpenTelemetry context even though the Processor isn't traced.

      Thanks !

      Attachments

        Issue Links

          Activity

            People

              jpoth John Poth
              jpoth John Poth
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: