zadig icon indicating copy to clipboard operation
zadig copied to clipboard

WIP: add prometheus metrics for services

Open detongz opened this issue 3 years ago • 1 comments

This commit is a proof of concept, each service need to modify its own Roter init function. In NewRouter function, inits the ResponseTime for its namespace(service). These services will have /metrics API for prometheus to pull metrics from them, instead of push metrics to prometheus. And this is not tested yet.

What this PR does / Why we need it:

Add Prometheus metrics for services. Fixes #issues/755

What is changed and how it works?

  1. +/metrics API for prometheus to pull metrics
  2. WIP/POC: collect response time for APIs.

Does this PR introduce a user-facing change?

  • [√] API change
  • [-] database schema change
  • [-] behavioral change
  • [√] change in non-functional attributes such as efficiency or availability
  • [√] fix of a previous issue

detongz avatar Feb 07 '22 07:02 detongz

This commit is a proof of concept, each service need to modify its own Roter init function. In NewRouter function, inits the ResponseTime for its namespace(service). These services will have /metrics API for prometheus to pull metrics from them, instead of push metrics to prometheus.

detongz avatar Feb 07 '22 07:02 detongz

long time no response, closed it for new Pull request.

landylee007 avatar Oct 17 '22 05:10 landylee007