danihodovic / celery-exporter

A Prometheus exporter for Celery metrics
MIT License
399 stars 87 forks source link

fix: Use event timestamp based on utcoffset #314

Closed reshab48 closed 1 month ago

reshab48 commented 1 month ago

celery-exporter has this feature to purge ofline worker metrics which default to 10 minutes. So any worker that is offline for more than 10 minutes, the metrics of which will be purged Now if celery workers is configured to use PST timezone (which is 7 hours behind UTC) or any other timezone that is not UTC, in such cases celery-exporter (running in UTC tz) considered live workers also to be offline because of this offset and this causes a continuous loop of live worker metrics to be purged and so we get inconsistent metrics.

Temp solution is to set CE_WORKER_TIMEOUT and CE_PURGE_OFFLINE_WORKER_METRICS to 7hrs + 10mins ahead

danihodovic commented 1 month ago

@adinhodovic can you chime in

danihodovic commented 1 month ago

Released as docker.io/danihodovic/celery-exporter:0.10.9

Thank you!