AgentObs.Handlers.Phoenix.Translator
(agent_obs v0.1.4)
View Source
Translates AgentObs event metadata to OpenInference semantic conventions.
This module is responsible for converting the backend-agnostic AgentObs event metadata into the flattened, indexed attribute format required by OpenInference.
OpenInference is an extension of OpenTelemetry semantic conventions specifically designed for AI and LLM observability. It enables rich, contextualized visualization in platforms like Arize Phoenix.
OpenInference Span Kinds
AGENT- Agent loop or orchestrationLLM- Large Language Model API callTOOL- Tool or function executionCHAIN- Sequence of operations (e.g., orchestrator iteration)RETRIEVER- Vector/document retrieval (not used in AgentObs currently)
Key Attributes
The translator produces flattened attributes following the OpenInference spec:
openinference.span.kind- The span kind (AGENT, LLM, TOOL, etc.)input.value/output.value- Primary input/outputllm.model_name- Model identifierllm.input_messages.N.message.role- Message role (user, assistant, etc.)llm.input_messages.N.message.content- Message contentllm.token_count.prompt/llm.token_count.completion- Token usagetool.name/tool.description- Tool metadata
References
- OpenInference Spec: https://arize-ai.github.io/openinference/spec/semantic_conventions.html
- Arize Phoenix Docs: https://arize.com/docs/phoenix/
Summary
Functions
Translates exception event metadata to OpenInference attributes.
Translates start event metadata to OpenInference attributes.
Translates stop event metadata to OpenInference attributes.
Functions
Translates exception event metadata to OpenInference attributes.
Parameters
event_type- One of:agent,:tool,:llm,:chain,:promptmetadata- The exception metadata from telemetrymeasurements- Measurements map containing duration
Returns
A map of OpenInference attributes for the exception.
Translates start event metadata to OpenInference attributes.
Parameters
event_type- One of:agent,:tool,:llm,:chain,:promptmetadata- The start metadata from AgentObs event
Returns
A map of OpenInference attributes (string keys, primitive values).
Translates stop event metadata to OpenInference attributes.
Parameters
event_type- One of:agent,:tool,:llm,:chain,:promptmetadata- The stop metadata from AgentObs eventmeasurements- Measurements map containing duration
Returns
A map of OpenInference attributes to be added to the span.