airflow.providers.common.ai.observability

OpenTelemetry tracing for pydantic-ai agents created by this provider.

pydantic-ai ships native OpenTelemetry instrumentation that emits GenAI spans (agent run, model call, tool call) following the OTel GenAI semantic conventions. This module turns it on and points it at Airflow’s existing OpenTelemetry exporter so agent spans flow to whatever OTLP backend the deployment already runs, nested under the worker’s task span.

It deliberately does not configure an exporter or a TracerProvider of its own: it reuses the global SDK provider that core tracing ([traces] otel_on) installs in the worker process. When that provider is absent (core tracing off, or not configured in this process) no spans are emitted.

Attributes

SECTION

Functions

genai_instrumentation_settings()

Build pydantic-ai InstrumentationSettings for an agent run.

Module Contents

airflow.providers.common.ai.observability.SECTION = 'common.ai'[source]
airflow.providers.common.ai.observability.genai_instrumentation_settings()[source]

Build pydantic-ai InstrumentationSettings for an agent run.

Returns None (leave the agent un-instrumented, zero overhead) when export is disabled or no live OTLP TracerProvider is configured in this worker process. include_content is off by default so prompts, completions, and tool IO are never emitted unless explicitly opted in via [common.ai] capture_content.

Was this entry helpful?