[ 
https://issues.apache.org/jira/browse/CAMEL-23369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18076602#comment-18076602
 ] 

Pasquale Congiusti commented on CAMEL-23369:
--------------------------------------------

Hi [~fmariani] - for telemetry, the approach you are suggesting is the correct 
one. Each component can be extended via Decorator. However mind that we should 
include a limited quantity of information to track for performance reasons.

For metrics I guess the situation is different. We have an implementation 
specific (Micrometer 
https://camel.apache.org/components/next/others/micrometer-prometheus.html) 
which is extended by runtime quarkus extension or springboot starter. You may 
think to extend that one. However, I think we should reason about Camel is 
collecting and exposing metrics related to its own state. IMO, adding an AI 
metric (or any other future technology metric) should answer to a question: is 
it something worth to create a dashboard or an alarm? For general Camel 
metrics, we can alarm when latency, cpu, etc - would it make sense for the new 
metric as well? how much is it really a customer pain or a requirement driven 
by hype?

> Add OpenTelemetry GenAI observability (traces and metrics) for AI components
> ----------------------------------------------------------------------------
>
>                 Key: CAMEL-23369
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23369
>             Project: Camel
>          Issue Type: Improvement
>    Affects Versions: 4.20.0
>            Reporter: Federico Mariani
>            Priority: Major
>
> Currently none of the Camel AI components (camel-openai, 
> camel-langchain4j-chat, camel-langchain4j-embeddings, camel-spring-ai-chat, 
> camel-google-vertexai, camel-aws-bedrock, camel-ibm-watsonx-ai) are 
> instrumented by the _camel-telemetry_ tracing framework or the metrics 
> frameworks (camel-opentelemetry-metrics, camel-micrometer).
> Similarly, the existing EventNotifier-based metrics (exchange duration, 
> in-flight gauges) don't capture AI-specific data like token counts.           
>                                                                               
>        
>                   
> The https://opentelemetry.io/docs/specs/semconv/gen-ai/ define standard span 
> attributes (gen_ai.operation.name, gen_ai.provider.name, 
> gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, 
> gen_ai.response.finish_reasons, etc.) and metrics (gen_ai.client.token.usage 
> histogram, gen_ai.client.operation.duration histogram) for LLM operations. 
> Camel AIs components already expose token counts and response metadata as 
> Camel message headers, but this data does not flow into distributed traces or 
> metrics.
> We might improve the current camel AI implementations, and expose all the 
> important metrics if not already exposed (for example, cache read and cache 
> write tokens)



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

Reply via email to