John Poth created CAMEL-20643:
---------------------------------
Summary: camel-opentelemetry - OpenTelemetryTracingStrategy does
not propagate OpenTelemetry Context in some cases
Key: CAMEL-20643
URL: https://issues.apache.org/jira/browse/CAMEL-20643
Project: Camel
Issue Type: Improvement
Components: camel-opentelemetry
Affects Versions: 4.5.0
Reporter: John Poth
Assignee: John Poth
Fix For: 4.6.0
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:
{code:java}
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
}
{code}
It would be nice to add an option in OpenTelemetryTracingStrategy to propagate
the OpenTelemetry context even though the Processor isn't traced.
Thanks !
--
This message was sent by Atlassian Jira
(v8.20.10#820010)