python prometheus


问题

  1. 对于sanic app,如果不是全局的共享内存,不同worker是分开统计的,导致从接口获取的数据有随机性(时而来源于worker1,时而来源于worker2)

参考资料

  1. https://prometheus.io/docs/concepts/metric_types/
  2. https://github.com/prometheus/client_python
  3. https://pyk.medium.com/a-guide-to-instrument-sanic-application-part-1-193b3eb403a