pushpendu1991 commented on code in PR #64900:
URL: https://github.com/apache/airflow/pull/64900#discussion_r3112397295
##########
providers/google/src/airflow/providers/google/cloud/operators/dataflow.py:
##########
@@ -1176,3 +1181,286 @@ def execute(self, context: Context):
raise AirflowException(self.response)
return None
+
+class DataflowGetMetricsOperator(GoogleCloudBaseOperator):
+ """
+ Fetches metrics for a Dataflow job and routes the result to one or more
+ destinations based on what the caller provides.
Review Comment:
Thanks @shahar1 for your inputs.
For one of the Databricks jobs, the volume of metrics—both system-generated
(GCP) and user-defined—can be quite high (sometimes reaching several KBs of
JSON). Because of this, I intentionally avoided pushing these metrics to XCom.
With thousands of concurrent dataflow jobs, this could significantly overload
the XCom table and impact system performance.
Instead, I’ve provided an option for users to route these metrics to an
external destination, such as:
- A BigQuery table, or
- A Pub/Sub topic
Alternatively, users can choose not to persist the metrics at all.
To keep the design simple and avoid unnecessary complexity, I suggest
restricting this to a single destination per run (either BigQuery or Pub/Sub),
rather than allowing both simultaneously.
Let me know your thoughts on this approach.
I have used Gemini to assist in drafting the documentation and comments. And
declared that in the PR now.
--
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]