bilbof commented on PR #23080: URL: https://github.com/apache/airflow/pull/23080#issuecomment-1105174827
Incrementing the timer by zero tells the receiver that the metric exists (sets it at zero) which is useful in cases where you want to capture the rate change from 0 to 1. Initializing metrics at zero is best practice for Prometheus metrics (which is how we're consuming the Statsd metrics from Airflow jobs). I've tested that should work with the Statsd Prometheus exporter locally: ``` # first shell docker run -p 9102:9102 -p 9125:9125 -it prom/statsd-exporter # second shell echo "foo:0|c" | nc localhost 9125 curl localhost:9102/metrics | grep foo # Result: # TYPE foo counter > foo 0 ``` -- 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]
