Telemetry
Integration collection

Python Telemetry Integrations

Instrument Python APIs, workers, database applications, and AI agent frameworks with synchronous or asyncio-safe structured events.

Reviewed by the Telemetry product team on . Runtime boundaries, shared event fields, verification workflow, and upstream implementation sources. Review standards and ownership

9 implementation guides

Every guide includes a server-side snippet, delivery and privacy boundaries, a verification query, related SQL, and links to upstream documentation.

Browse guides

Selection framework

Choose the boundary that knows the result

Match sync and async execution

Use the synchronous client for ordinary workers and the async client for asyncio request or agent paths so telemetry does not block the event loop.

Emit after the transaction boundary

A successful handler is not a successful business outcome until the database commit, queued task, or model workflow has reached its durable boundary.

Categorize exceptions before logging

Record a controlled error type and failed step. Avoid raw exception text when it can contain SQL parameters, prompts, secrets, or customer content.

Shared event contract

Keep the first schema interoperable

  • operation, status, duration_ms, release, and environment
  • request_id, task_id, run_id, account_id, and controlled error_type
  • attempt, model, provider, tool_name, and database operation where relevant

Adapt these fields to the workflow, but keep units, status categories, identifiers, and ownership explicit before several services depend on the same table.

Verification

Exercise failure paths before alerts

  1. 1Exercise one synchronous and one asynchronous path when the application uses both.
  2. 2Confirm events are emitted after commit or terminal task status.
  3. 3Test cancellation, timeout, retry, and process-shutdown behavior.
  4. 4Inspect inferred field types before building the first query.

Implementation guides

Match the framework, provider, or runtime

Sourced implementation guide

Python and FastAPI Structured Logging

Capture FastAPI request outcomes and latency with the asynchronous Telemetry client and normalized route names.

Open guide
Sourced implementation guide

Django and Celery Structured Event Monitoring

Connect Django request outcomes and Celery task lifecycles with safe identifiers, latency, retries, and terminal status.

Open guide
Sourced implementation guide

Flask and SQLAlchemy Telemetry

Measure Flask request outcomes and SQLAlchemy transaction behavior with bounded Python events, stable route templates, and safe error categories.

Open guide
Sourced implementation guide

Pydantic AI Agent Telemetry

Measure Pydantic AI run outcomes, validated outputs, retries, tool activity, latency, usage, and product acceptance with safe structured events.

Open guide
Sourced implementation guide

CrewAI Workflow Telemetry

Track CrewAI crew and flow outcomes, task counts, handoffs, retries, latency, cost, and accepted results without retaining agent conversations.

Open guide
Sourced implementation guide

LlamaIndex Agent Telemetry

Track LlamaIndex agent and workflow outcomes, tool activity, latency, retrieval versions, cost, and reviewed quality with structured events.

Open guide
Sourced implementation guide

DSPy Program Evaluation Telemetry

Measure DSPy program latency, failures, metric scores, optimizer versions, model cost, and accepted outcomes across releases with SQL-ready events.

Open guide
Sourced implementation guide

AutoGen Multi-Agent Telemetry

Track AutoGen team and agent outcomes, messages, tool activity, handoffs, latency, failures, cost, and releases with compact structured events.

Open guide
Sourced implementation guide

LiteLLM Gateway and SDK Telemetry

Track LiteLLM provider routing, retries, fallbacks, token usage, latency, cost estimates, and accepted outcomes across a controlled model gateway.

Open guide

Verify one end-to-end workflow first

Create a free API key, choose the closest runtime guide, and send one known success and failure before expanding coverage.

Start free