Skip to content

Add team_name tag to OpenLineage metrics - #69109

Merged
ferruzzi merged 5 commits into
apache:mainfrom
SameerMesiah97:68996-OpenLineage-Team-Name-Metrics
Jul 10, 2026
Merged

Add team_name tag to OpenLineage metrics#69109
ferruzzi merged 5 commits 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.

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 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.

Notes

A typographical error ('deg') in the docstring for dag_version_info has been corrected.

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 4 times, most recently 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
Comment thread providers/openlineage/src/airflow/providers/openlineage/utils/utils.py Outdated
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jul 2, 2026
@SameerMesiah97

Copy link
Copy Markdown
Contributor Author

@ferruzzi

This is just a reminder for review.

Comment thread providers/openlineage/src/airflow/providers/openlineage/plugins/listener.py Outdated
Comment thread providers/openlineage/src/airflow/providers/openlineage/plugins/listener.py Outdated
Comment thread providers/openlineage/tests/unit/openlineage/utils/test_utils.py Outdated
@SameerMesiah97
SameerMesiah97 force-pushed the 68996-OpenLineage-Team-Name-Metrics branch from e3f59ba to 240ab79 Compare July 6, 2026 21:44
@SameerMesiah97
SameerMesiah97 requested a review from ferruzzi July 6, 2026 23:23
@SameerMesiah97
SameerMesiah97 force-pushed the 68996-OpenLineage-Team-Name-Metrics branch from 240ab79 to 3de74a8 Compare July 8, 2026 20:03

@kacpermuda kacpermuda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small but important change needed.

@SameerMesiah97
SameerMesiah97 force-pushed the 68996-OpenLineage-Team-Name-Metrics branch from 3de74a8 to 90cfb6f Compare July 9, 2026 20:54
Comment thread providers/openlineage/src/airflow/providers/openlineage/utils/utils.py Outdated

@kacpermuda kacpermuda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@ferruzzi ferruzzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With @kacpermuda approving the OL side, I'm happy to approve this. Thanks to both of you.

Sameer Mesiah added 3 commits July 10, 2026 21:40
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.
…nd reuse the existing team_name value when emitting metrics.
…ssociated unit tests by removing unnecessary database markers and simplifying the test cases.
Sameer Mesiah added 2 commits July 10, 2026 21:40
…or the fallback path, and restore the required db_test markers for the DagRunInfo tests.
@SameerMesiah97
SameerMesiah97 force-pushed the 68996-OpenLineage-Team-Name-Metrics branch from 90cfb6f to c338d5b Compare July 10, 2026 20:41
@ferruzzi
ferruzzi merged commit 8175e0c into apache:main Jul 10, 2026
105 checks passed
joshuabvarghese pushed a commit to joshuabvarghese/airflow that referenced this pull request Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:openlineage AIP-53 ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants