discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
525 stars 153 forks source link

feature: add latency to delayed job metrics #285

Closed martinramirez7 closed 11 months ago

martinramirez7 commented 11 months ago

This PR adds latency for delayed job jobs

martinramirez7 commented 11 months ago

Hey @SamSaffron, would you take a quick look of this please? thanks in advance!

SamSaffron commented 11 months ago

can you also amend the readme here? Is the latency going to be accurate, can you explain the value of the metric? Also looks like CI is failing

martinramirez7 commented 11 months ago

we are trying to implement queues based on latency, the whole idea is explained here. The main concept is to have queues that ensures that all of their jobs will start running in no less time than certain latency. This metric allows to detect if an increase in CPU or number of workers is needed for a certain queue.

can you also amend the readme here?

where exactly?

SamSaffron commented 11 months ago

where exactly?

REAMDE.md in the root :)

martinramirez7 commented 11 months ago

I already included the metric in the readme I'm not sure if you wanted me to add anything else. About the accuracy, there might be some loss of precision because of the sleep_delay parameter implemented by delayed job I am mentioning it in the README too. Also, all the workflows should be passing now, would you please run the tests again?

SamSaffron commented 11 months ago

I think we had some internal examples of time mocking without timecop, can we move to that, after that is done I am happy to merge!

martinramirez7 commented 11 months ago

Thanks Sam! Timecop removed

SamSaffron commented 11 months ago

looks good, thanks!