Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.5.0
-
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
- links to