Federico Mariani created CAMEL-27132:
----------------------------------------

             Summary: camel-ai-observability-starter - the options are 
thread-local and do not reach the AI producers
                 Key: CAMEL-27132
                 URL: https://issues.apache.org/jira/browse/CAMEL-27132
             Project: Camel
          Issue Type: Bug
          Components: camel-spring-boot-starters
    Affects Versions: 4.23.0
            Reporter: Federico Mariani


{{AiObservabilityAutoConfiguration}} (camel-ai-observability-starter, added by 
CAMEL-24555) sets the {{camel.aiobservability.*}} options with 
{{PropertiesComponent.setLocalProperties}} 
({{AiObservabilityAutoConfiguration.java:70}}). Local properties are kept in a 
{{ThreadLocal}} ({{PropertiesComponent}}), so they are only visible on the 
thread that ran the auto-configuration.

The AI producers read the options on the threads that route the messages (for 
example the {{task-*}} threads of {{platform-http}}), where they are not set. 
So {{camel.aiobservability.enabled=false}} does not turn off the GenAI spans 
and metrics of a Spring Boot application.

Camel Main makes the same options available to every thread with 
{{PropertiesComponent.addOverrideProperty}} 
({{BaseMainSupport.setAiObservabilityProperties}}). The starter should do the 
same, with a test that resolves the option from another thread.

_Claude Code on behalf of Croway_




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to