Description
OpenTelemetry has published semantic conventions specifically for Generative AI observability, which provide a standardized way to instrument LLM interactions. Adopting these conventions would improve interoperability with enterprise observability platforms that support OTel.
Current State
coder/coder
- Uses OpenTelemetry for tracing with OTLP export (
coderd/tracing/exporter.go)
- Supports multiple backends: default OTLP, Datadog, Honeycomb
- Uses standard semconv v1.14.0 for service metadata
- No GenAI-specific semantic conventions implemented
coder/aibridge
- Has custom tracing attributes in
tracing/tracing.go: interception_id, user_id, provider, model, streaming, mcp_tool_name, etc.
- Spans named like Intercept,
Intercept.ProcessRequest, Intercept.RecordTokenUsage
- Token usage tracked, but not using GenAI semconv
Proposed Changes
- Span naming: Use
gen_ai.completion, gen_ai.chat conventions
- Attributes: Map current attributes to semconv equivalents:
model → gen_ai.request.model
provider → gen_ai.system (e.g., openai, anthropic)
- Token counts →
gen_ai.usage.input_tokens, gen_ai.usage.output_tokens
- Events: Use
gen_ai.choice for response events
- Metrics: Consider GenAI metrics conventions for token usage histograms
Benefits — Enterprise Observability Compatibility
Adopting OTel GenAI semconv enables out-of-the-box integration with leading enterprise observability platforms:
- Datadog — AI Observability with native OTel support
- Dynatrace — Enterprise APM with full OTel integration
- Splunk — Observability Cloud with OTel collector
- New Relic — Full-stack observability with OTel support
- Grafana/Tempo — Open-source tracing with OTel backend
- AppDynamics — Enterprise APM with OTel compatibility
- Chronosphere — Cloud-native observability platform
This enables customers using any of these platforms to get standardized AI observability dashboards and alerting without custom instrumentation.
References
Description
OpenTelemetry has published semantic conventions specifically for Generative AI observability, which provide a standardized way to instrument LLM interactions. Adopting these conventions would improve interoperability with enterprise observability platforms that support OTel.
Current State
coder/coder
coderd/tracing/exporter.go)coder/aibridge
tracing/tracing.go:interception_id,user_id,provider,model,streaming,mcp_tool_name, etc.Intercept.ProcessRequest,Intercept.RecordTokenUsageProposed Changes
gen_ai.completion,gen_ai.chatconventionsmodel→gen_ai.request.modelprovider→gen_ai.system(e.g.,openai,anthropic)gen_ai.usage.input_tokens,gen_ai.usage.output_tokensgen_ai.choicefor response eventsBenefits — Enterprise Observability Compatibility
Adopting OTel GenAI semconv enables out-of-the-box integration with leading enterprise observability platforms:
This enables customers using any of these platforms to get standardized AI observability dashboards and alerting without custom instrumentation.
References