Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom labels not working after upgrade to Airflow 2.3.1 #113

Open
akepa opened this issue Jun 15, 2022 · 1 comment
Open

Custom labels not working after upgrade to Airflow 2.3.1 #113

akepa opened this issue Jun 15, 2022 · 1 comment

Comments

@akepa
Copy link

akepa commented Jun 15, 2022

Airflow version: 2.3.1
airflow-exporter: 1.5.3

Hello,

we have upgraded recently our Airflow from 2.2.5 to 2.3.1 and we have seen that after the upgrade, the feature to include custom labels in the metrics is not working anymore.

with DAG(
        dag_id='my_dag',
        schedule_interval="10 * * * *",
        start_date=days_ago(1),
        default_args={},
        max_active_runs=1,
        tags=['tag1', 'tag2'],
        params={'labels': {
            'custom_label': 'custom_label_value'
        }}
) as dag:
...

with previous version, /metrics endpoint was exposing the following metrics:

airflow_dag_status{dag_id="my_dag",owner="airflow",status="failed", custom_label="custom_label_value"} 169.0
airflow_dag_status{dag_id="my_dag",owner="airflow",status="running", custom_label="custom_label_value"} 1.0
airflow_dag_status{dag_id="my_dag",owner="airflow",status="success", custom_label="custom_label_value"} 203.0

after the upgrade, it is not including the custom label

airflow_dag_status{dag_id="my_dag",owner="airflow",status="failed"} 169.0
airflow_dag_status{dag_id="my_dag",owner="airflow",status="running"} 1.0
airflow_dag_status{dag_id="my_dag",owner="airflow",status="success"} 203.0
@akepa
Copy link
Author

akepa commented Jun 15, 2022

Seems to be related to https://github.com/epoch8/airflow-exporter/blob/master/airflow_exporter/prometheus_exporter.py#L203.

I've been debugging in local with 2.3.2 and

dag.params.get('labels', {})

has now the following content:

{'custom_label': 'custom_label_value'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant