epoch8 / airflow-exporter

Airflow plugin to export dag and task based metrics to Prometheus.
Other
248 stars 75 forks source link

How to get the latest status of a particular DAG? #79

Closed michalrudko closed 3 years ago

michalrudko commented 4 years ago

I saw an example of using airflow-exporter metrics but I am not quite clear on the use case behind it: airflow_dag_status{dag_id="dummy_dag",env="test",owner="owner",status="running"} 12.0 What is needed in most cases is a status of the last run - especially if the status is other than "success" in order to apply some alerts and notifications on top of that. So my question is - how I could contruct a PromQL query that would tell me what's the latest status of my dummy_dag? At the end of the day I would like to construct a matrix of panels in Grafana with the statuses (and other features) of all the DAGs. Thanks!

jimduden6804 commented 3 years ago

I am also looking for a solution for this Problem.... It is the most valuable information for us whether the last run was successful.

elephantum commented 3 years ago

Take a look at #96 pls, is it something that solves your use case?

elephantum commented 3 years ago

Fixed by #96