johnpoth commented on PR #15496:
URL: https://github.com/apache/camel/pull/15496#issuecomment-2348408770

   @davsclaus IMO we would need a new SPI for `ThreadPoolFactory` in Camel to 
allow us to grab the current Exchange the Thread is running on. This would 
allow camel-opentelemetry to do something like this before every thread:
   
   ```
       @Override  
           public Future<?> submit(Runnable task, Exchange exchange) {  
           Context context = 
exchange.getProperty(ExchangePropertyKey.ACTIVE_SPAN, 
io.opentelemetry.context.Context.Context.class)
           return delegate().submit(context.wrap(task));  
       }
   ```
   
   That way, other libraries in the Thread know what context to grab. Most 
libraries do a Context.current() which relies on ThreadLocal storage...
   
   


-- 
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]

Reply via email to