squakez commented on code in PR #20529:
URL: https://github.com/apache/camel/pull/20529#discussion_r2639022572
##########
components/camel-telemetry/src/main/java/org/apache/camel/telemetry/TraceProcessorsInterceptStrategy.java:
##########
@@ -57,15 +65,48 @@ public void process(Exchange exchange) throws Exception {
if (tracer.isTraceProcessors() && !tracer.exclude(processor,
exchange.getContext())) {
tracer.beginProcessorSpan(exchange, processor);
try {
- target.process(exchange);
+ asyncProcessor.process(exchange);
} finally {
tracer.endProcessorSpan(exchange, processor);
}
} else {
// We must always execute this
- target.process(exchange);
+ asyncProcessor.process(exchange);
}
}
+
+ @Override
+ public boolean process(Exchange exchange, AsyncCallback callback) {
+ String processor = processorDefinition.getId() + "-" +
processorDefinition.getShortName();
+ if (tracer.isTraceProcessors() && !tracer.exclude(processor,
exchange.getContext())) {
+ try {
+ tracer.beginProcessorSpan(exchange, processor);
+ } catch (Exception e) {
+ exchange.setException(e);
Review Comment:
I think it must continue anyway. The tracing logic may break for any
situation outside the user control and should not break the execution which is
completely decoupled by the tracing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]