dlespiau / balance

Client side load balancing for Kubernetes clusters
Apache License 2.0
18 stars 1 forks source link

Add some Prometheus metrics #9

Closed bboreham closed 3 years ago

bboreham commented 3 years ago

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.)

bboreham commented 3 years ago

@dlespiau gentle ping

dlespiau commented 3 years ago

eeeek, completely missed that, sorry!