The Simplest Way to Make Airflow and Lightstep Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use airflow and lightstep together to track pipeline runs from start to finish. Airflow runs the scheduled tasks, while Lightstep collects traces and metrics to show slow steps. When a daily job slows down, logs alone do not show the full story. Traces link each task run to the database queries and API calls it makes. This setup helps data teams find and fix broken pipelines fast. How data and keys flow between airflow and lightstep Airflow schedulers and workers create trace spans eac

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use airflow and lightstep together to track pipeline runs from start to finish. Airflow runs the scheduled tasks, while Lightstep collects traces and metrics to show slow steps.

When a daily job slows down, logs alone do not show the full story. Traces link each task run to the database queries and API calls it makes. This setup helps data teams find and fix broken pipelines fast.

How data and keys flow between airflow and lightstep

Airflow schedulers and workers create trace spans each time a DAG or task runs. A telemetry collector sits near the workers to gather these spans and metrics. The collector then sends that data over the network to Lightstep using an ingestion key.

Each task span carries tags like the DAG ID, task name, and run ID. If a task calls an external service, it can pass trace headers along. Lightstep reads these headers and joins the pipeline step with the downstream service trace.

Permissions flow in two directions in this setup. First, Airflow workers need permission to send telemetry data to the local collector. Second, the collector needs a valid ingestion key to write trace data into the Lightstep project. Engineers also log in to Lightstep with their own user roles to read those traces.

Common failure modes and how to scope roles

One common problem is using a single shared ingestion key across every pipeline group. If one team leaks that key, an attacker can flood your project with fake traces. A shared key also makes it hard to rotate secrets without breaking all pipelines.

Another failure happens when workers send raw task variables or query text inside span tags. Those tags often hold user emails, phone numbers, card numbers, or database secrets. Anyone with read roles in the tracing tool can then see that private data.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Network paths and worker exit points also cause missing traces in short tasks. Airflow workers often finish a task and shut down before sending the last spans. You should route spans to a local collector agent so workers do not block or drop data.

To fix access risks, give each environment and team its own scoped ingestion key. Set strict network rules so only approved collector nodes can talk to external endpoints. Strip sensitive fields at the collector level before any trace leaves your cluster.

You also need strong controls when engineers debug a failed Airflow task directly. A trace tells you which database query failed, so an engineer must check the live system. Instead of sharing static database passwords stored in Airflow variables, require individual user roles and full query logging.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Why are my short Airflow tasks missing from Lightstep traces?

Short tasks often exit before the worker flushes trace data over the network. Send spans to a local collector agent on the same host to capture every run.

How do we keep sensitive task data out of trace tags?

Do not pass raw task parameters or query bodies into span attributes. Set rules in your telemetry collector to redact emails, phone numbers, and card numbers before export.

Should Airflow workers send traces straight to Lightstep?

No, direct exports make key management hard and add network delay to your workers. Run a central collector that holds the ingestion key and batches spans safely.

The query runs. The emails stay hidden.