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
Use this when you want one Agnost AI event per agent turn with the exact input and output you choose.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
PraisonAI sends provider-prefixed models such asanthropic/claude-haiku-4-5 through LiteLLM.
The OpenInference LiteLLM instrumentor turns each model call into an OpenInference LLM span,
which Agnost AI accepts. PraisonAI does not emit agent or tool spans of its own, so the setup
below adds them with OpenInference’s @tracer.agent and @tracer.tool decorators.
Install
Setup
TracerProvider here comes from openinference.instrumentation. It is the standard OpenTelemetry
SDK provider plus the agent and tool decorators. using_attributes puts session.id and
user.id on every span inside the block, so Agnost AI groups the run into one conversation and
attributes it to the user.
One agent.start() call with one tool call produces four events in Agnost AI:
- an
agentevent namedweather-agentwith the prompt as input and the final answer as output - one
llmevent per model call, with the user message, the reply, the model name, and token counts - a
toolevent namedget_weatherwith the tool arguments and result
@tracer.tool keeps the function name, signature, and docstring, so PraisonAI still builds the
same tool schema from it.
PraisonAI calls the OpenAI SDK directly, not LiteLLM, when
model is a bare OpenAI name such as
gpt-4o-mini. For that case also install openinference-instrumentation-openai and call
OpenAIInstrumentor().instrument(tracer_provider=provider) next to the LiteLLM instrumentor.Verify
Run onerun_agent(...) call, then open Conversations in Agnost AI and find sess-123.
Confirm the conversation shows user u-42, an agent event, llm events with input and output
text, and a tool event for each tool the agent called.
Troubleshooting
- No events: confirm
OTEL_EXPORTER_OTLP_HEADERScontainsX-Agnost-Org-ID=<your-org-id>and thatprovider.force_flush()runs before a short script exits. - No
llmevents: callLiteLLMInstrumentor().instrument(...)before the first agent run, and use a provider-prefixed model such asanthropic/..., or add the OpenAI instrumentor for bare OpenAI model names. - Every run is a separate conversation: wrap the call in
using_attributes(session_id=..., user_id=...)and reuse the samesession_idfor later turns. - No
toolevents: decorate the tool functions with@tracer.toolbefore passing them toAgent(tools=[...]). - Use one method per call path. Combining the Agnost AI SDK and OpenTelemetry on the same run creates duplicate events.
References
- PraisonAI observability overview
- PraisonAI tools
- OpenInference LiteLLM instrumentation
- OpenInference tracing helpers (
@tracer.agent,@tracer.tool)
Next steps
- Conversations: review the complete PraisonAI run.
- Events: inspect agent, LLM, and tool events.
- Patterns: organize production conversations by what users wanted.