Add Prometheus metrics to let operators see what is going on inside the consistent hash balancer.
Metrics are put in a namespace taken from the name of the program so, if you link this library into a program called frontend, you will get these metrics:
metric
description
frontend_lb_requests_inflight
Total number of requests in-flight
frontend_lb_endpoints
Number of endpoints for this service
frontend_lb_requests_total
Number of processed requests
frontend_lb_requests_overflowed_total
Number of requests that overflowed the load factor
Each has a label name so that different balancers within the program have their own metrics.
(I did this about 8 months ago and coming back to it I find several aspects of the design questionable; I was generally going for minimal disruption to APIs but maybe went too far. Let me know what you think.)
Add Prometheus metrics to let operators see what is going on inside the consistent hash balancer.
Metrics are put in a namespace taken from the name of the program so, if you link this library into a program called
frontend
, you will get these metrics:Each has a label
name
so that different balancers within the program have their own metrics.(I did this about 8 months ago and coming back to it I find several aspects of the design questionable; I was generally going for minimal disruption to APIs but maybe went too far. Let me know what you think.)