Camel Spring Boot

Ai Observability

Spring Boot auto-configuration for Camel GenAI observability.

Add this starter to opt in to GenAI observability for Camel AI producers. It brings camel-ai-observability, so the AI producers emit OpenTelemetry spans and Micrometer metrics once a tracing or metrics backend is on the classpath as well, for example camel-opentelemetry2-starter. camel-observability-services-starter does not include it: add this starter as well when the application uses it.

Configure it in application.properties:

# Disable GenAI observability for all AI producers (default is true)
camel.aiobservability.enabled=false
# How much is recorded: basic (default), detailed or full; full records prompts and completions
camel.aiobservability.level=detailed
# Maximum length of every text recorded at level full (default 8192)
camel.aiobservability.content-max-length=4096
# Do not record a model or tool call that the AI framework already traces, such as Spring AI (default true)
camel.aiobservability.defer-to-framework=true

Relaxed binding also accepts camel.aiObservability. and camel.ai-observability.. The options are handed to the Camel PropertiesComponent as override properties named camel.aiObservability.enabled, camel.aiObservability.level, camel.aiObservability.contentMaxLength and camel.aiObservability.deferToFramework, matching Camel Main and JBang.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-ai-observability-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 4 options, which are listed below.

Name Description Default Type

camel.aiobservability.content-max-length

The maximum length of every text (message, tool argument or result) recorded at level full. Longer texts are cut.

8192

Integer

camel.aiobservability.defer-to-framework

When the AI framework behind a component already traces its model calls and tool calls (Spring AI with an ObservationRegistry, quarkus-langchain4j, a LangChain4j model with an observation listener), Camel does not record its own span and metrics for them, so that they are counted once.

true

Boolean

camel.aiobservability.enabled

Enables GenAI observability for Camel AI producers (OpenTelemetry spans and Micrometer metrics when backends are present).

true

Boolean

camel.aiobservability.level

How much GenAI telemetry is recorded: basic, detailed or full. basic records one span per LLM call with model, token usage and finish reason. detailed adds the structure of agent runs (an agent span with one span per LLM call and per tool call), request parameters, cached tokens and the conversation id. full adds prompts, completions and tool arguments and results, which may hold personal or confidential data. Metrics are not affected.

basic

String