YonatanKiron opened a new issue, #35036:
URL: https://github.com/apache/airflow/issues/35036

   ### Apache Airflow version
   
   2.7.2
   
   ### What happened
   
   I have two DAGs that constantly pass, one reported to otel agent while the 
other didn't.
   
   After looking into the logs (in debug mode) it seems like the metric 
`airflow.dagrun.duration.success` contains only one value.
   
   ```
               {
                 "name": 
"airflow.dagrun.duration.success.airflow.fail_hanging_dagruns",
                 "description": "",
                 "unit": "",
                 "data": {
                   "data_points": [
                     {
                       "attributes": {
                         "dag_id": "airflow.fail_hanging_dagruns",
                         "run_type": "scheduled"
                       },
                       "start_time_unix_nano": 0,
                       "time_unix_nano": 1697655156630862800,
                       "value": 19.202272
                     }
                   ]
                 }
               },
               {
                 "name": "airflow.dagrun.duration.success",
                 "description": "",
                 "unit": "",
                 "data": {
                   "data_points": [
                     {
                       "attributes": {
                         "dag_id": "airflow.fail_hanging_dagruns",
                         "run_type": "scheduled"
                       },
                       "start_time_unix_nano": 0,
                       "time_unix_nano": 1697655156630862800,
                       "value": 19.202272
                     }
                   ]
                 }
               },
               {
                 "name": 
"airflow.dagrun.schedule_delay.system.random.dag.status",
                 "description": "",
                 "unit": "",
                 "data": {
                   "data_points": [
                     {
                       "attributes": {},
                       "start_time_unix_nano": 0,
                       "time_unix_nano": 1697655156630862800,
                       "value": 0.647526
                     }
                   ]
                 }
               },
   ```
   
   
   ### What you think should happen instead
   
   airflow.dagrun.duration.success value should contain a list of values 
instead of one
   
   ```
               {
                 "name": 
"airflow.dagrun.duration.success.airflow.fail_hanging_dagruns",
                 "description": "",
                 "unit": "",
                 "data": {
                   "data_points": [
                     {
                       "attributes": {
                         "dag_id": "airflow.fail_hanging_dagruns",
                         "run_type": "scheduled"
                       },
                       "start_time_unix_nano": 0,
                       "time_unix_nano": 1697655156630862800,
                       "value": 19.202272
                     }
                   ]
                 }
               },
               {
                 "name": "airflow.dagrun.duration.success",
                 "description": "",
                 "unit": "",
                 "data": {
                   "data_points": [
                     {
                       "attributes": {
                         "dag_id": "airflow.fail_hanging_dagruns",
                         "run_type": "scheduled"
                       },
                       "start_time_unix_nano": 0,
                       "time_unix_nano": 1697655156630862800,
                       "value": 19.202272
                     },
                     {
                       "attributes": {
                         "dag_id": "system.random.dag.status",
                         "run_type": "scheduled"
                       },
                       "start_time_unix_nano": 0,
                       "time_unix_nano": 1697655156630862800,
                       "value": 0.647526
                     }
                   ]
                 }
               },
               {
                 "name": 
"airflow.dagrun.schedule_delay.system.random.dag.status",
                 "description": "",
                 "unit": "",
                 "data": {
                   "data_points": [
                     {
                       "attributes": {},
                       "start_time_unix_nano": 0,
                       "time_unix_nano": 1697655156630862800,
                       "value": 0.647526
                     }
                   ]
                 }
               },
   ```
   
   
   ### How to reproduce
   
   Create 2 dummy DAGs that pass and watch the metrics
   
   ### Operating System
   
   Docker bitnami/airflow:2.7.2
   
   ### Versions of Apache Airflow Providers
   
   ```
   apache-airflow-providers-amazon==7.4.1
   apache-airflow-providers-apache-cassandra==3.2.1
   apache-airflow-providers-apache-drill==2.4.4
   apache-airflow-providers-apache-druid==3.5.0
   apache-airflow-providers-apache-hdfs==4.1.1
   apache-airflow-providers-apache-hive==6.1.6
   apache-airflow-providers-apache-impala==1.1.3
   apache-airflow-providers-apache-pinot==4.1.4
   apache-airflow-providers-arangodb==2.2.2
   apache-airflow-providers-celery==3.3.4
   apache-airflow-providers-cloudant==3.2.1
   apache-airflow-providers-cncf-kubernetes==7.6.0
   apache-airflow-providers-common-sql==1.7.2
   apache-airflow-providers-daskexecutor==1.0.1
   apache-airflow-providers-databricks==4.5.0
   apache-airflow-providers-docker==3.7.5
   apache-airflow-providers-elasticsearch==5.0.2
   apache-airflow-providers-exasol==4.2.5
   apache-airflow-providers-ftp==3.5.2
   apache-airflow-providers-google==10.9.0
   apache-airflow-providers-grpc==3.2.2
   apache-airflow-providers-hashicorp==3.4.3
   apache-airflow-providers-http==4.5.2
   apache-airflow-providers-imap==3.3.2
   apache-airflow-providers-influxdb==2.2.3
   apache-airflow-providers-microsoft-azure==7.0.0
   apache-airflow-providers-microsoft-mssql==3.4.2
   apache-airflow-providers-mongo==3.2.2
   apache-airflow-providers-mysql==5.3.1
   apache-airflow-providers-neo4j==3.3.3
   apache-airflow-providers-postgres==5.6.1
   apache-airflow-providers-presto==5.1.4
   apache-airflow-providers-redis==3.3.2
   apache-airflow-providers-sendgrid==3.2.2
   apache-airflow-providers-sftp==4.6.1
   apache-airflow-providers-slack==8.1.0
   apache-airflow-providers-sqlite==3.4.3
   apache-airflow-providers-ssh==3.7.3
   apache-airflow-providers-trino==5.3.1
   apache-airflow-providers-vertica==3.5.2
   ```
   
   ### Deployment
   
   Other 3rd-party Helm chart
   
   ### Deployment details
   
   bitnami/airflow
   
   ### Anything else
   
   I suspect that this code block is overriding the metrics `key` every time 
instead of appending it's values in case of existence 
   
   
https://github.com/apache/airflow/blob/2.7.2/airflow/metrics/otel_logger.py#L327-L343
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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]

Reply via email to