Federico Mariani created CAMEL-24570:
----------------------------------------

             Summary: camel-ai-observability: log when GenAI observability 
silently falls back to no-op
                 Key: CAMEL-24570
                 URL: https://issues.apache.org/jira/browse/CAMEL-24570
             Project: Camel
          Issue Type: Improvement
          Components: camel-ai
    Affects Versions: 4.23.0
            Reporter: Federico Mariani


GenAI observability (camel-ai-observability, Preview since 4.23.0) has two 
fallback paths that today are completely silent (DEBUG-only or no log at all), 
which makes misconfiguration very hard to diagnose:

1. *Missing implementation module*: {{GenAiObservability}} (in 
{{camel-ai-observability-api}}) loads {{GenAiObservabilityImpl}} reflectively. 
When {{camel-ai-observability}} is not on the classpath, every observation is a 
no-op: no spans, no metrics, no log line (only DEBUG). A user who adds 
{{camel-ai-observability-starter}} (which only brings the api module) and 
enables {{camel.aiobservability.enabled=true}} gets nothing, with no hint about 
the missing jar.

2. *Observation path without a tracing handler*: on Spring Boot, an Actuator 
{{ObservationRegistry}} is always present, so {{GenAiObservabilityImpl}} 
prefers the Micrometer Observation backend and does not create the GenAI CLIENT 
span through camel-telemetry/camel-opentelemetry2. If the registry has no 
tracing handler (i.e. micrometer-tracing with the OTel bridge is not 
configured), the Observation path produces no GenAI trace at all - as 
documented in ai-observability.adoc - again with no log line. Route spans are 
still exported by camel-opentelemetry2, so the user sees traces without the 
gen_ai spans and has no pointer to the cause.

This was hit while reworking the camel-spring-boot-examples genai-observability 
example: traces were exported but the gen_ai spans were silently dropped until 
micrometer-tracing-bridge-otel was added.

Proposal: emit a one-time INFO (or WARN when 
{{camel.aiobservability.enabled=true}} was set explicitly) in both fallback 
paths, e.g.:
- "GenAI observability enabled but camel-ai-observability is not on the 
classpath - spans and metrics will not be emitted"
- "GenAI observations are recorded on an ObservationRegistry without a tracing 
handler - gen_ai spans will not be exported"



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to