{"repo":"mpihlak/mongoproxy","free":true,"listed":false,"github":"https://github.com/mpihlak/mongoproxy","clone":"git clone https://github.com/mpihlak/mongoproxy.git","description":"Lightweight proxy to collect MongoDb client metrics","language":"Rust","stars":55,"topics":["metrics","sidecar","mongodb","tracing","observability"],"license":"MIT","category":"analytics","readme_excerpt":"Mongoproxy the Observable There are many MongoDb proxies, but this one is about observability. It passes bytes between client and the server and records query latencies, response sizes, document counts and exposes them as Prometheus metrics. It also does Jaeger tracing if the client passes a trace id in the $comment field of the operation. All bytes are passed through unchanged. Furthermore, the metrics processing is decoupled from the proxying so that latency or bugs in the metrics processor have no impact on moving the bytes. In the backend it uses Tokio for async IO and a custom streaming BSON parser to only extract the interesting bits from the stream. Current state Supports MongoDb 3.6 and greater ( OP MSG protocol), and produces throughput and latency metrics both at the network and document level. The legacy OP COMMAND protocol used by some drivers and older Mongo versions is not fully supported. The proxy won't crash or anything but the collected metrics will be limited. Jaeger tracing is supported for OP MSG protocol (sorry, no legacy clients) and only for operations that support $comment strings. Performance is good. Expect to add just few millicores for the proxy process and < 10 MB of memory used. The actual numbers depend on the workload. Usage Sidecar with iptables port forwarding This mode is used when running the proxy as a sidecar on a K8s pod. iptables rules need to be set up to redirect all port 27017 traffic through the proxy. The proxy then determines the","default_branch":null,"files":null,"tree":[],"storefront":"/r/mpihlak","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mpihlak/mongoproxy/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}