Spanora

OTEL Attribute Conventions for AI Tracing

Semantic attribute conventions for AI observability used by the Spanora platform and SDK. Covers gen_ai.* standard attributes and spanora.* custom attributes.

The SDK emits gen_ai.* (OTEL GenAI Semantic Conventions) where a standard attribute exists, and spanora.* only for attributes with no gen_ai equivalent. The backend recognizes both, plus OpenInference and Vercel AI SDK namespaces.

Standard Attributes (gen_ai.*)

AttributeDescriptionExample
gen_ai.provider.nameLLM provider"openai"
gen_ai.request.modelModel name"gpt-4"
gen_ai.input.messagesPrompt inputJSON array
gen_ai.output.messagesModel outputJSON array
gen_ai.usage.input_tokensInput token count150
gen_ai.usage.output_tokensOutput token count89
gen_ai.tool.nameTool name"search_docs"
gen_ai.tool.inputTool call input arguments'{"query":"docs"}'
gen_ai.tool.outputTool call output'{"results":[...]}'
gen_ai.conversation.idSession/conversation ID"sess_abc123"
gen_ai.agent.nameAgent name"support-bot"
gen_ai.operation.nameLLM operation type (set per-span by trackLlm/provider wrappers, not by track())"chat"

Custom Attributes (spanora.*)

These attributes have no gen_ai equivalent:

AttributeDescriptionExample
spanora.agent.versionAgent version"1.2.0"
spanora.user.idUser context"user_123"
spanora.org.idTenant context"org_456"
spanora.agent.outcomeExecution outcome"success"
spanora.agent.failure.reasonFailure reason"timeout"
spanora.tool.statusTool execution status"ok"

Usage Example

attributes.ts
span.setAttributes({
  // Standard gen_ai attributes
  "gen_ai.provider.name": "openai",
  "gen_ai.request.model": "gpt-4",
  "gen_ai.operation.name": "chat",

  // Custom attributes (no gen_ai equivalent)
  "spanora.user.id": "user_123",
  "spanora.org.id": "org_456",
});

On this page