Bowrna opened a new issue, #33426: URL: https://github.com/apache/airflow/issues/33426
### What do you see as an issue? For the airflow statsd metric received at the statsd client, the metric `dagrun.schedule_delay` described in airflow docs says it sends the seconds of delay between the scheduled DagRun start date and the actual DagRun start date. <img width="1059" alt="Screenshot 2023-08-16 at 10 47 30 AM" src="https://github.com/apache/airflow/assets/10162465/572f24de-d831-4b64-b61e-c3913e34b605"> But in the code, it sends the difference of the two datetime and datetime datatype is sent to the statsd timer metrics. In the client end it is received as the float object. Though the Airflow UI doesn't indicate any schedule delay, the metrics received has data like below ``` {'metric': 'airflow.dagrun.schedule_delay.test_spark', 'points': [[1692013326, [720730.214]]], 'type': 'timers', 'host': 'airflow'} ``` Here the metrics points received is float and it could be microsecond / millisecond value of the datetime object as there is no conversion to seconds before setting it in Statsd metrics. <img width="956" alt="Screenshot 2023-08-16 at 10 48 23 AM" src="https://github.com/apache/airflow/assets/10162465/75193972-0986-4e00-bdcc-061e80276f92"> ### Solving the problem Either converting the datetime object to seconds / milliseconds will fix the issue. Or if we are setting the datetime object in the statsd timer having a clear docs on what to expect value and its metric at statsd client end would be useful ### Anything else _No response_ ### 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]
