Skip to main content
Pydantic AI uses Logfire for instrumentation. Point Logfire’s OTLP exporter at Agnost and disable its hosted backend.
Pydantic AI/Logfire traces can include prompts, completions, tool call arguments, and full message history. Review Data Governance before enabling production traffic.

Install

Setup

Spans use OTel GenAI semconv (gen_ai.input.messages, gen_ai.output.messages, gen_ai.tool.call.arguments, gen_ai.usage.*) plus pydantic_ai.all_messages. gen_ai.conversation.id is emitted natively when message history is provided to the agent.

Caveats

Do not set LOGFIRE_TOKEN: that re-enables the hosted backend.

Verify

Run one agent.run_sync call, then open Raw logs in Agnost. Confirm gen_ai.* and pydantic_ai.* attributes are present.

Troubleshooting

  • Keep send_to_logfire=False if you do not want dual-send to Logfire.
  • Do not set LOGFIRE_TOKEN unless you explicitly want hosted Logfire enabled.
  • Confirm OTEL_EXPORTER_OTLP_HEADERS contains X-Agnost-Org-ID=<your-org-id>.

References