Skip to main content

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. 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.
Install the skill once in your coding-agent environment:
Run the framework-specific prompt below from the application root. Review the resulting diff before deploying it.

Manual setup: Agnost AI SDK

Call 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 ships AtomicAgentsInstrumentor 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

Tested with 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

What each piece does:
  • AtomicAgentsInstrumentor().instrument() traces AtomicAgent.run (and run_async, run_stream, run_async_stream), every BaseTool.run, and each model call Instructor makes, including retries after a validation error.
  • TracingConfig(capture_messages=True) adds gen_ai.input.messages and gen_ai.output.messages to 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=...) puts session.id, gen_ai.conversation.id, and user.id on every Atomic Agents span inside the block. Every turn with the same session_id lands in the same Agnost AI conversation. This needs the phoenix extra.
  • The agent_turn span 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.
In a long-running server, create the 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 as original_conversation_id in the conversation metadata.
  • Users: the user_id you pass to using_attributes.
  • Messages: the user’s message and the agent’s answer for each turn, from the agent_turn span.
  • Events: the turn and the support-agent run (both agent, 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 your user_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 calls provider.shutdown() or provider.force_flush() before it exits. BatchSpanProcessor exports in the background.
  • ModuleNotFoundError from instrument(): install "atomic-agents[observability]" or "atomic-agents[phoenix]".
  • User or conversation is missing: install the phoenix extra, and call the agent inside the using_attributes block. Without OpenInference installed, use atomic_agents.observability.using_conversation(session_id) for the conversation, and set user.id on the agent_turn span.
  • Each tool and agent call is a separate transcript turn: run them inside the agent_turn span.
  • Model events have no message text: pass TracingConfig(capture_messages=True), or set ATOMIC_AGENTS_TRACE_CAPTURE_MESSAGES=true.
  • Each model call appears twice: you also run a provider instrumentor such as openinference-instrumentation-anthropic. Remove it, or pass TracingConfig(llm_spans=False).
  • The tool shows up as its input schema’s class name: set BaseToolConfig(title=...) to the name you want.

References

Next steps

  • Conversations: review the complete Atomic Agents session.
  • Events: inspect agent, model, and tool activity.
  • Patterns: organize production conversations by what users wanted.