Federico Mariani created CAMEL-27139:
----------------------------------------
Summary: camel-telemetry - name the spans after the route and the
step, not only after the HTTP method or the component
Key: CAMEL-27139
URL: https://issues.apache.org/jira/browse/CAMEL-27139
Project: Camel
Issue Type: Improvement
Components: camel-opentelemetry, camel-telemetry
Reporter: Federico Mariani
The span names say what the endpoint is, not which route or step it belongs to:
* the consumer span of an HTTP route is named after the HTTP method, for
example {{POST}} ({{AbstractHttpSpanDecorator.getOperationName}});
* the other endpoint spans are named after the component, for example
{{openai}} or {{spring-ai-chat}} ({{AbstractSpanDecorator.getOperationName}}).
Tracing backends list and filter traces by the name of their root span, so all
the traces of an application with several HTTP routes are called {{POST}}, and
a route with several model calls shows a row of {{openai}} spans. Seen while
testing Camel AI routes with Langfuse (CAMEL-27131), where the Python
frameworks name their traces after the agent or the workflow.
Proposal:
* The HTTP server span could follow the OpenTelemetry HTTP conventions, which
name it after the method and the route template when the template is known, for
example {{POST /chat}}, and after the method alone otherwise.
* An opt-in option of the tracer could name the consumer span after the route
id when the route has a custom one ({{routeId("support-chat")}}), and an
endpoint span after the step id when it is set
({{.to("openai:chat-completion").id("classify-intent")}}). The HTTP method, the
URL and the component stay available as attributes.
_Claude Code on behalf of Croway_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)