SameerMesiah97 opened a new pull request, #69109: URL: https://github.com/apache/airflow/pull/69109
**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.1.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.1+ 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? - [X] Yes (please specify the tool below) Generated-by: [GPT 5.5] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
