diff --git a/airflow_prometheus_exporter/prometheus_exporter.py b/airflow_prometheus_exporter/prometheus_exporter.py index a0d24ee..232d458 100644 --- a/airflow_prometheus_exporter/prometheus_exporter.py +++ b/airflow_prometheus_exporter/prometheus_exporter.py @@ -120,6 +120,10 @@ def get_dag_duration_info(): == dag_start_dt_query.c.execution_date, ), ) + .filter( + TaskInstance.start_date.isnot(None), + TaskInstance.end_date.isnot(None), + ) .all() ) @@ -479,7 +483,6 @@ def collect(self): if RBAC: from flask_appbuilder import BaseView as FABBaseView, expose as FABexpose - class RBACMetrics(FABBaseView): route_base = "/admin/metrics/"