[ 
https://issues.apache.org/jira/browse/CAMEL-23861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-23861:
--------------------------------
    Fix Version/s: 4.22.0

> camel-langchain4j - Add OpenTelemetry and Micrometer observability for AI/LLM 
> usage
> -----------------------------------------------------------------------------------
>
>                 Key: CAMEL-23861
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23861
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-langchain4j-agent, camel-langchain4j-chat, 
> camel-langchain4j-embeddings, camel-langchain4j-tools
>            Reporter: Claus Ibsen
>            Priority: Major
>              Labels: ai, observability
>             Fix For: 4.22.0
>
>
> The camel-langchain4j components currently have no observability integration 
> for AI/LLM-specific metrics and tracing. Token usage, model name, finish 
> reason, and latency are not captured.
> Spring AI exposes this data through the Micrometer Observation API (which 
> produces both metrics and traces) following the OpenTelemetry Semantic 
> Conventions for GenAI (https://opentelemetry.io/docs/specs/semconv/gen-ai/). 
> This enables dashboards showing token consumption, costs, model distribution, 
> and conversation tracking.
> Camel should follow the same approach. When camel-micrometer or 
> camel-opentelemetry2 is active, the langchain4j producers should capture:
> *OpenTelemetry span attributes (GenAI semantic conventions):*
> - gen_ai.system (e.g. openai, anthropic)
> - gen_ai.request.model
> - gen_ai.response.model
> - gen_ai.usage.input_tokens
> - gen_ai.usage.output_tokens
> - gen_ai.response.finish_reasons
> *Micrometer metrics:*
> - Token counters (input/output/total) with model tag
> - Request counters per model/operation
> - Latency timers/histograms
> - Error counters
> This would allow standard observability tooling (Grafana, Jaeger, Prometheus, 
> etc.) and Camel TUI to visualize AI/LLM usage across routes.
> See also CAMEL-23860 which adds token data as exchange headers - this ticket 
> is about propagating that data into the observability layer for monitoring 
> and dashboards.



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

Reply via email to