python prometheus
问题
- 对于sanic app,如果不是全局的共享内存,不同worker是分开统计的,导致从接口获取的数据有随机性(时而来源于worker1,时而来源于worker2)
参考资料
- https://prometheus.io/docs/concepts/metric_types/
- https://github.com/prometheus/client_python
- https://pyk.medium.com/a-guide-to-instrument-sanic-application-part-1-193b3eb403a