New google dataflow operator to fetch job metrics#64900
Open
pushpendu1991 wants to merge 16 commits intoapache:mainfrom
Open
New google dataflow operator to fetch job metrics#64900pushpendu1991 wants to merge 16 commits intoapache:mainfrom
pushpendu1991 wants to merge 16 commits intoapache:mainfrom
Conversation
Added BQ_DATASET_LOCATION
added bq_dataset_location
Added BQ_DATASET_LOCATION
added bq_dataset_location
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Google Cloud Dataflow operator to fetch job metrics and optionally route them to Pub/Sub and/or BigQuery, supporting both synchronous and deferrable execution, along with unit/system tests and documentation.
Changes:
- Introduces
DataflowGetMetricsOperatorwith routing to Pub/Sub and BigQuery, including deferrable trigger-based execution. - Adds unit tests covering init, sync routing scenarios, deferrable execution, and
execute_complete. - Adds a system test example DAG and updates Dataflow operator docs with usage snippets.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| providers/google/src/airflow/providers/google/cloud/operators/dataflow.py | Implements DataflowGetMetricsOperator including routing and deferrable support. |
| providers/google/tests/unit/google/cloud/operators/test_dataflow.py | Adds unit tests for the new operator’s behavior. |
| providers/google/tests/system/google/cloud/dataflow/example_dataflow_get_metrics.py | Adds a system-test example DAG demonstrating operator usage. |
| providers/google/docs/operators/cloud/dataflow.rst | Documents the new operator with example includes. |
providers/google/tests/system/google/cloud/dataflow/example_dataflow_get_metrics.py
Show resolved
Hide resolved
providers/google/tests/system/google/cloud/dataflow/example_dataflow_get_metrics.py
Outdated
Show resolved
Hide resolved
providers/google/tests/system/google/cloud/dataflow/example_dataflow_get_metrics.py
Outdated
Show resolved
Hide resolved
providers/google/tests/system/google/cloud/dataflow/example_dataflow_get_metrics.py
Outdated
Show resolved
Hide resolved
providers/google/tests/unit/google/cloud/operators/test_dataflow.py
Outdated
Show resolved
Hide resolved
providers/google/src/airflow/providers/google/cloud/operators/dataflow.py
Outdated
Show resolved
Hide resolved
providers/google/src/airflow/providers/google/cloud/operators/dataflow.py
Show resolved
Hide resolved
providers/google/src/airflow/providers/google/cloud/operators/dataflow.py
Outdated
Show resolved
Hide resolved
providers/google/src/airflow/providers/google/cloud/operators/dataflow.py
Show resolved
Hide resolved
providers/google/tests/unit/google/cloud/operators/test_dataflow.py
Outdated
Show resolved
Hide resolved
Updated documentation formatting and improved clarity on deferrable parameter behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new Google dataflow operator that fetches metrics from Google Cloud Dataflow jobs and routes them to one or more destinations (Pub/Sub, BigQuery, or both) in a single operation. The operator supports both synchronous blocking and asynchronous deferrable execution modes for optimal resource utilization.
Apache Airflow's Google Cloud provider package does not include a native operator for:
Programmatic Dataflow Job Metrics Collection — Users currently rely on dataflow hook or dataflow API to collect Dataflow job metrics. There is no built-in Airflow operator to fetch metrics directly from a Dataflow job within a DAG.
Multi-Destination Metrics Routing — Enterprises often need to send the same metrics to multiple systems for different purposes (e.g., Pub/Sub for real-time alerting, BigQuery for historical analysis). There is no simple way to fan-out metrics to multiple destinations atomically.
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.