reef-technologies / cookiecutter-rt-django

CookieCutter template for Django application projects with docker-compose etc.
BSD 3-Clause "New" or "Revised" License
18 stars 22 forks source link

Refresh migration metrics every metrics export #187

Closed luca-medeiros-reef closed 3 months ago

luca-medeiros-reef commented 4 months ago

Closes #186

Every metrics call will get the latest migration-related metrics.

luca-medeiros-reef commented 4 months ago

Yeah, I was worried it would add too much load (as it has to query the db too). A quick single-user locust run shows relevant load but is still in an acceptable range for a Prometheus with a 5~30s refresh rate. Old: avg 34ms New: avg 82ms

image
luca-medeiros-reef commented 4 months ago

We could further improve and refresh db migration metrics less often

luca-medeiros-reef commented 4 months ago

I'll check what can be done upstream. Given that the issue was raised over a year ago with no response, I doubt they will go further to merge a PR regarding this. (Wonder if this is expected behavior..)

Will look into Prometheus custom-collectors and come up with a PR upstream.