ferruzzi commented on code in PR #55971:
URL: https://github.com/apache/airflow/pull/55971#discussion_r2373302902
##########
airflow-core/src/airflow/models/deadline.py:
##########
@@ -240,6 +249,20 @@ def handle_callback_event(self, event: TriggerEvent,
session: Session):
self.callback_state = status
if status != DeadlineCallbackState.RUNNING:
self.trigger = None
+ if status == DeadlineCallbackState.FAILED:
+ Stats.incr(
+ "deadline_alerts.deadline_callback_failure",
+ tags={
+ "dag_id": self.dagrun.dag_id,
+ "callback": self._callback,
+ "result": event.payload.get(PAYLOAD_BODY_KEY),
+ },
+ )
+ elif status == DeadlineCallbackState.SUCCESS:
+ Stats.incr(
+ "deadline_alerts.deadline_callback_success",
+ tags={"dag_id": self.dagrun.dag_id},
Review Comment:
I'll make the change. Also, I know we discussed it offline, but I'll drop
it here for posterity. We should add an optional "name" field to the
DeadlineAlert model in the future. Since users can define a list of deadlines
per Dag that would be a much easier way to see which is failing than using the
_callback like I did here. But that's future work.
--
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]