diff --git a/airflow_exporter/prometheus_exporter.py b/airflow_exporter/prometheus_exporter.py index 344d164..230ab16 100644 --- a/airflow_exporter/prometheus_exporter.py +++ b/airflow_exporter/prometheus_exporter.py @@ -200,9 +200,9 @@ def get_dag_labels(dag_id: str) -> Dict[str, str]: labels = dag.params.get('labels', {}) - if hasattr(labels, 'value'): + if hasattr(labels, 'items'): # Airflow version 2.2.* - labels = {k:v for k,v in labels.value.items() if not k.startswith('__')} + labels = {k:v for k,v in labels.items() if not k.startswith('__')} else: # Airflow version 2.0.*, 2.1.* labels = labels.get('__var', {}) @@ -352,4 +352,4 @@ class AirflowPrometheusPlugins(AirflowPlugin): flask_blueprints = [] # type: ignore menu_links = [] # type: ignore appbuilder_views = [RBACmetricsView] - appbuilder_menu_items = [] # type: ignore \ No newline at end of file + appbuilder_menu_items = [] # type: ignore