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.
Instrument Python APIs, workers, database applications, and AI agent frameworks with synchronous or asyncio-safe structured events.
Reviewed by the Telemetry product team on . We checked where the code runs, shared event fields, verification steps, and the linked implementation guides. Who reviews this page
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 guidesSelection framework
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.
Wait for the database commit, queued task, or model workflow to finish before logging success. A handler can return successfully while that work is still pending.
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
Adapt these fields to your workflow. Document units, allowed statuses, and identifiers before several services write to the same table. Name the team responsible for the schema.
Verification
Implementation guides
Capture FastAPI request outcomes and latency with the asynchronous Telemetry client and normalized route names.
Open guideConnect Django request outcomes and Celery task lifecycles with safe identifiers, latency, retries, and final status.
Open guideRecord Flask request results and SQLAlchemy transaction behavior with approved Python event fields, consistent route templates, and safe error categories.
Open guideMeasure Pydantic AI run outcomes, validated outputs, retries, tool activity, latency, usage, and product acceptance with safe structured events.
Open guideTrack CrewAI crew and flow outcomes, task counts, handoffs, retries, latency, cost, and accepted results without retaining agent conversations.
Open guideTrack LlamaIndex agent and workflow outcomes, tool activity, latency, retrieval versions, cost, and reviewed quality with structured events.
Open guideMeasure DSPy program latency, failures, metric scores, optimizer versions, model cost, and accepted outcomes across releases with SQL-ready events.
Open guideTrack AutoGen task-flow state, timeouts, team and agent outcomes, tool activity, handoffs, latency, failures, cost, and releases with compact structured events.
Open guideTrack LiteLLM provider routing, retries, fallbacks, token usage, latency, cost estimates, and accepted outcomes across a controlled model gateway.
Open guideCreate a free API key, choose the closest runtime guide, and send one known success and failure before expanding coverage.