python-microservices / pyms

Library of utils to create REST Python Microservices
https://python-microservices.github.io/home/
GNU General Public License v3.0
265 stars 45 forks source link

Metrics are not multiprocess #227

Open alexppg opened 3 years ago

alexppg commented 3 years ago

Describe the bug Is not a bug per se, since we don't have to change anything in pyms to make it work, what https://github.com/python-microservices/pyms/pull/179 did was ok. The problem is that it's not enough.

The problem can be reproduced using pyms with gunicorn with at least two workers and do a lot of http requests to the metrics endpoint. You'll see that each response has different values, which shows that each worker has it's own count of the metrics.

I'll add this just to track it, I'm seeing at he moment how to fix it. It will probable be just a PR with more documentation.