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.
Manual setup: OpenTelemetry
Agent Framework instruments everyAgent with OpenTelemetry using the GenAI semantic conventions. It emits an invoke_agent span per run, a chat span per model call, and an execute_tool span per tool call. Export those spans to Agnost AI, turn on content capture, and add a small span processor that writes your session and user IDs onto every span. This guide uses the Python package.
Install
agent-framework-anthropic is a prerelease package and pulls in agent-framework-core. Use the client package of your model provider instead if you do not use Claude. Agent Framework does not install an OTLP exporter for you.
Setup
exporters=[OTLPSpanExporter(...)]sends traces only. Agnost AI stores traces, so do not setOTEL_EXPORTER_OTLP_ENDPOINTfor it, which would also send logs and metrics.enable_sensitive_data=Trueadds prompts, answers, tool arguments, and tool results to the spans. Without it, Agnost AI receives the events with no content. You can setENABLE_SENSITIVE_DATA=trueinstead.AgnostContextProcessoraddssession.idanduser.idto each span. Agent Framework setsgen_ai.conversation.idonly when the provider manages the conversation on its side, and it never records a user ID. Agnost AI groups all runs with the samesession.idinto one conversation and attributes it touser.id.
AgnostContextProcessor to your own tracer provider and call enable_instrumentation(enable_sensitive_data=True) from agent_framework.observability instead of configure_otel_providers().
What appears in Agnost AI
- Conversations: one per
session.id. The raw value is kept asoriginal_conversation_idin the conversation metadata. - Users: the
user.idset inask. - Messages: the user’s message and the agent’s final answer for each
agent.run(...)call, from the rootinvoke_agentspan. - Events:
invoke_agent,chat, andexecute_toolspans in a nested tree. Model events carry token counts. Tool events carry the tool name, arguments, and result.
Verify
Run one agent turn, wait about 30 seconds, then open Conversations in Agnost AI. Confirm the conversation shows your user ID, a user message and an assistant answer, and aget_weather tool event with arguments and a result.
Troubleshooting
- Nothing arrives: install
opentelemetry-exporter-otlp-proto-http, confirm the header isX-Agnost-Org-IDand the endpoint ends in/v1/traces. Short scripts must calltrace.get_tracer_provider().force_flush()before they exit. - Events have no prompts, answers, or tool arguments: pass
enable_sensitive_data=Trueor setENABLE_SENSITIVE_DATA=true. - Each turn is its own conversation, or the user is empty: the run happened outside
ask, orAgnostContextProcessorwas not added to the tracer provider. - Model calls appear twice: the Anthropic Python SDK 2.x also emits its own
anthropic.messages.createspan for each API call, without message content. SetANTHROPIC_OPEN_TELEMETRY=falseto turn it off.
References
Next steps
- Conversations: review the complete Agent Framework session.
- Events: inspect agent, model, and tool activity.
- Patterns: organize production conversations by what users wanted.