Choose a setup method
Start with one method for a call path. Combining SDK tracking with framework
OpenTelemetry on the same call can create duplicate interactions.
Recommended: Agnost AI skill
Recommended. Choose this path when you want your coding agent to inspect the
project, select a supported transport, make the smallest instrumentation change,
send a test event, and verify that it reached Agnost AI.
Manual setup: Agnost AI SDK
agnost.shutdown() once when the application exits, not after each request.
Shutting down per request disables telemetry for later agent runs in the same process.
Manual setup: OpenTelemetry
Atomic Agents shipsAtomicAgentsInstrumentor in atomic_agents.observability. It emits OpenTelemetry spans that follow the GenAI semantic conventions: one invoke_agent span per agent run, one chat span per model call Instructor makes, and one execute_tool span per BaseTool run. Agnost AI ingests those spans directly. The phoenix extra adds OpenInference attributes, which lets using_attributes put the session and user on every span.
1. Install
atomic-agents 2.16.2, instructor 1.17.0, anthropic 0.93.0, openinference-instrumentation 0.1.83, and opentelemetry-sdk 1.45.2 on Python 3.12.
2. Point OpenTelemetry at Agnost AI and run an agent
AtomicAgentsInstrumentor().instrument()tracesAtomicAgent.run(andrun_async,run_stream,run_async_stream), everyBaseTool.run, and each model call Instructor makes, including retries after a validation error.TracingConfig(capture_messages=True)addsgen_ai.input.messagesandgen_ai.output.messagesto model spans. Without it, model spans carry only the model name and token counts. Agent and tool spans record their input and output either way.using_attributes(user_id=..., session_id=...)putssession.id,gen_ai.conversation.id, anduser.idon every Atomic Agents span inside the block. Every turn with the samesession_idlands in the same Agnost AI conversation. This needs thephoenixextra.- The
agent_turnspan becomes the root of each trace. Atomic Agents has no tool loop: your code calls tools and agents one after another, and without a parent each call is its own trace and its own transcript entry. Agnost AI builds the conversation transcript from each trace’s root span, so the wrapper holds the user’s message and the final answer.
TracerProvider and call instrument() once at startup, call run_turn per request, and call provider.shutdown() on graceful shutdown.
What appears in Agnost AI
- Conversations: one per
session_id. Agnost AI keeps the raw session ID asoriginal_conversation_idin the conversation metadata. - Users: the
user_idyou pass tousing_attributes. - Messages: the user’s message and the agent’s answer for each turn, from the
agent_turnspan. - Events: the turn and the
support-agentrun (bothagent, the run with its input and output schemas as JSON), each model call (llm) with the request messages and token counts, and each tool run (tool) with the tool name, arguments, and result. Atomic Agents gets structured output from Claude as a tool call, so model events show no reply text. The reply is on the agent event.
Verify
Run the script, wait up to a minute for ingestion, then open Conversations in Agnost AI. Confirm the conversation shows youruser_id, a user message and an assistant answer, a get_order_status tool event with arguments and a result, and a support-agent event.
Troubleshooting
- Nothing arrives: confirm the exporter’s headers contain
X-Agnost-Org-ID, and that the script callsprovider.shutdown()orprovider.force_flush()before it exits.BatchSpanProcessorexports in the background. ModuleNotFoundErrorfrominstrument(): install"atomic-agents[observability]"or"atomic-agents[phoenix]".- User or conversation is missing: install the
phoenixextra, and call the agent inside theusing_attributesblock. Without OpenInference installed, useatomic_agents.observability.using_conversation(session_id)for the conversation, and setuser.idon theagent_turnspan. - Each tool and agent call is a separate transcript turn: run them inside the
agent_turnspan. - Model events have no message text: pass
TracingConfig(capture_messages=True), or setATOMIC_AGENTS_TRACE_CAPTURE_MESSAGES=true. - Each model call appears twice: you also run a provider instrumentor such as
openinference-instrumentation-anthropic. Remove it, or passTracingConfig(llm_spans=False). - The tool shows up as its input schema’s class name: set
BaseToolConfig(title=...)to the name you want.
References
- Atomic Agents observability guide
- Atomic Agents Phoenix tracing example
- OpenInference tracing helpers
Next steps
- Conversations: review the complete Atomic Agents session.
- Events: inspect agent, model, and tool activity.
- Patterns: organize production conversations by what users wanted.