Skip to content

Add team_name tag to OpenLineage metrics#69109

Open
SameerMesiah97 wants to merge 1 commit into
apache:mainfrom
SameerMesiah97:68996-OpenLineage-Team-Name-Metrics
Open

Add team_name tag to OpenLineage metrics#69109
SameerMesiah97 wants to merge 1 commit into
apache:mainfrom
SameerMesiah97:68996-OpenLineage-Team-Name-Metrics

Conversation

@SameerMesiah97

@SameerMesiah97 SameerMesiah97 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Description

This change adds a team_name tag to OpenLineage metrics to improve observability in multi-team deployments.

The following metrics now include the team_name tag when available:

  • ol.emit.attempts
  • ol.emit.failed
  • ol.extract
  • ol.event.size

A new DagRunInfo.team_name() helper has been added to resolve the team associated with a DagRun from its DAG bundle.

The helper caches team name lookups on a per-bundle basis, avoiding repeated database lookups when multiple task instances belong to the same DAG bundle.

For listener metrics (ol.extract and ol.event.size), the team_name is resolved directly from the DagRun. For adapter metrics (ol.emit.attempts and ol.emit.failed), the value is propagated through the Airflow run facet attached to the emitted OpenLineage event.

Rationale

The OpenLineage integration emits metrics for lineage extraction and event publication, but these metrics could not previously be attributed to individual teams in multi-team deployments.

Adding the team_name tag enables per-team dashboards, alerting, and troubleshooting while remaining backwards compatible for deployments that do not use multi-team scheduling.

Tests

Added unit tests for the new DagRunInfo.team_name() helper, including cache behaviour and multi-team configuration handling.

Updated the existing OpenLineage listener and adapter unit tests to verify metric emission both with and without the team_name tag. Test cases covering the presence of team_name are skipped when running against Airflow versions earlier than 3.3.0.

Backwards Compatibility

This change is additive only. Existing metric names remain unchanged, and the team_name tag is emitted only when running on Airflow 3.3+ with multi-team enabled. Existing dashboards and integrations that do not use the new tag continue to function unchanged.

Related: #68996

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [GPT 5.5] following the guidelines

@SameerMesiah97 SameerMesiah97 force-pushed the 68996-OpenLineage-Team-Name-Metrics branch 3 times, most recently from 044f8d5 to 588db94 Compare June 29, 2026 20:17
when multi-team is enabled on Airflow 3.1+.

The team name is propagated through the Airflow run facet and included in
ol.emit.attempts, ol.emit.failed, ol.extract, and ol.event.size.
Tests are updated accordingly.
@SameerMesiah97 SameerMesiah97 force-pushed the 68996-OpenLineage-Team-Name-Metrics branch from 588db94 to e3f59ba Compare June 29, 2026 20:21
@SameerMesiah97 SameerMesiah97 marked this pull request as ready for review June 29, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant