waterWang opened a new pull request, #72112: URL: https://github.com/apache/airflow/pull/72112
closes #72110 ## Problem With `[metrics] statsd_datadog_enabled = True`, every metric emitted via `Stats.timer()` is under-reported by 1000x. `Stats.timing()` metrics are unaffected, so units become inconsistent on the same backend. `datadog`'s `timed()` context manager defaults to `use_ms=False`, so it reports the elapsed time in **seconds** even though the metric is sent with the `|ms` type. Airflow's `Timer` measures in **milliseconds** (`1000.0 * (time.perf_counter() - start)`). ## Fix Pass `use_ms=True` to `dogstatsd.timed()` in `SafeDogStatsdLogger.timer()` so elapsed times are reported in milliseconds, consistent with `Stats.timing()` and Airflow's own `Timer.duration`. ## Tests Updated the existing `TestDogStats.test_timer` assertion to expect `use_ms=True`. -- 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]
