[ ] Create a middleware that can generate dynamic Prometheus counters using prom-client based on the API endpoint.
[ ] For multi-instance deployment of service, counters in each service will be synced with each other using Redis or any other storage mechanism.
[ ] For an event (e.g.: successful 200 response) associated value of the counter should be updated in Redis and then the counter should be synced with Redis.
[ ] When Prometheus scrapes the /metrics endpoint of service, sync the counter value with Redis before sending out the value.
Problem statement.
/metrics
endpoint of service, sync the counter value with Redis before sending out the value.