I have a use case where I need to count every request arriving to all endpoints of my services on Kubernetes. For example
**endpoint** **counter** addr:port/a: 1 addr:port/a/pathX: 4 addr:port/a/pathY: 5 addr:port/a/pathY/subpathM: 7 addr:port/b: 3 addr:port/b/another-path: 7
Currently, I'm using a custom reverse-proxy that I've implemented in Go, but it has a terrible performance. My server can handle roughly handle ~16k RPS, with Envoy ~15.8k, with Traefik ~12k, and with my implementation ~2k :(
Envoy (or even Traefik) has much better performance than my proxy but AFAIK they can't count hits to endpoints as I need. This counters should be exposed as metrics to be scraped by Prometheus.
Have Envoy or Traefik this feature that I need? If yes, how can I use it? If they don't, there is another proxy with this feature? Perhaps Nginx or HAproxy.
In case of doesn't exists a proxy with this feature, which GoLang HTTP library has best performance to implement this kind of proxy?
My deployment is made on Kubernetes and the proxy is supposed to be a sidecar of each pod of my system. Performance is a must and it is better if it have a small memory footprint.
Any idea is welcome :-)