Closed tegk closed 4 years ago
At the time, I think we cared about the jobs running right now. Also, I don't recall if that data is easy to get from gearman.
I haven't used this code in a long time, so if you - or someone else is interested - I can transfer ownership.
@tegk This functionality isn't possible as you cannot know if a job has completed by the time the second scrape has. If you have a scrape interval of 30 seconds but each job takes 1 minute then the job will be counted twice by a counter.
The counting would have to be done by Gearman.
@tegk This functionality isn't possible as you cannot know if a job has completed by the time the second scrape has. If you have a scrape interval of 30 seconds but each job takes 1 minute then the job will be counted twice by a counter.
The counting would have to be done by Gearman.
That's why you would always increment and let Prometheus calculate the rate
@tegk This functionality isn't possible as you cannot know if a job has completed by the time the second scrape has. If you have a scrape interval of 30 seconds but each job takes 1 minute then the job will be counted twice by a counter. The counting would have to be done by Gearman.
That's why you would always increment and let Prometheus calculate the rate
The counter carries the risk of overcounting long running jobs, so the rate as calculated by Prometheus could appear higher than what it actually is.
If at t0 you have jobs a,b,c running then the counter would be 3, if at t1 you have jobs a,d,e running (i.e. a is long running) then the counter would be 6 even though there have actually only been 5 jobs
Why not use a counter that counts up rather than to count the current jobs?