Build Daily

Tinley Park · August 23, 2026
The Data and AI GuyAug 13, 2026

Airflow + OpenTelemetry: Trace Your Pipelines Locally

What it covers

This video demonstrates how to set up local observability for Apache Airflow pipelines using OpenTelemetry, Tempo, Prometheus, and Grafana. It covers configuring tracing, instrumenting custom code with spans and metrics, and visualizing performance bottlenecks in a flame graph.

The outline

Tap a timestamp to jump there in the video.

  1. Introduction to Pipeline Tracing

    The video introduces the problem of slow data pipelines and proposes using OpenTelemetry to trace Airflow tasks locally.

  2. Architecture Overview

    The presenter outlines the local Docker stack architecture where Airflow emits traces to an OpenTelemetry collector that fans out to Tempo and Prometheus for Grafana visualization.

  3. Demo Pipeline Structure

    A simple five-task ELT pipeline is introduced, featuring tasks like API extraction, validation, transformation, loading, and metric publishing.

  4. Instrumenting Tasks with Spans

    The code for the demo pipeline is examined to show how manual spans are created around task logic and enriched with attributes like HTTP methods and row counts.

  5. Simulating Performance Bottlenecks

    Nested spans are used within a transform task to simulate a slow step, specifically an 'enrich' operation that sleeps for eight seconds to create a visible delay in the trace.

  6. Configuring Airflow Tracing

    Environment variables are configured to enable Airflow's built-in tracing and point it to the local OpenTelemetry collector using specific gRPC and HTTP ports for traces and metrics.

  7. Custom Instrumentation Toolkit

    A utility file is created to provide helpers for creating custom tracers, flushing spans before task completion, and recording SLI metrics like rows processed and data freshness.

  8. Context Propagation Across Boundaries

    Functions are implemented to inject and extract W3C trace context headers, allowing traces to propagate across network boundaries between different services or tasks.

  9. Visualizing Traces in Grafana

    The local Grafana instance is used to search for the pipeline's trace ID, revealing a detailed view of task durations and nested spans within the Airflow DAG run.

  10. OpenTelemetry Collector Configuration

    The collector's YAML configuration is reviewed to show how it receives telemetry on specific ports and routes traces to Tempo while republishing metrics for Prometheus scraping.

Local observability for solo pipelines

Tracing pipeline delays before they reach production helps a solo builder spot slow tasks early. Pairing Airflow with OpenTelemetry and Grafana makes performance bottlenecks visible without relying on external teams.