activejob_latency measures difference between when the job was enqueued at and when it ran. However, this number is not correct and shows very big latency when job is scheduled to run in the future because the wait time is included in the latency.
Recently we started using latency based queues and in my opinion job latency should be measured as the difference between when the job was scheduled to run at and when it actually ran.
I will create a PR with the change. First, I would like to discuss whether you would prefer to add a new metric (activejob_scheduled_latency) or fix the current one (activejob_latency). What would you prefer?
activejob_latencymeasures difference between when the job was enqueued at and when it ran. However, this number is not correct and shows very big latency when job is scheduled to run in the future because the wait time is included in the latency.Recently we started using latency based queues and in my opinion job latency should be measured as the difference between when the job was scheduled to run at and when it actually ran.
I will create a PR with the change. First, I would like to discuss whether you would prefer to add a new metric (
activejob_scheduled_latency) or fix the current one (activejob_latency). What would you prefer?