zalando / skipper

An HTTP router and reverse proxy for service composition, including use cases like Kubernetes Ingress
https://opensource.zalando.com/skipper/
Other
3.11k stars 351 forks source link

metrics for active connections and pending HTTP requests #1159

Open aryszka opened 5 years ago

aryszka commented 5 years ago

Connection metrics

Currently we cannot measure the current connection count in Skipper. This would be useful for various reasons, one of the is to have clues for the right size of the used connection pool.

We should measure the following things:

Incoming/Outgoing TCP connections

Easy to detect when new connections are created, but somewhat tricky to detect when they are closed/broken. In case of the incoming connections, solutions seem to generally rely on the connections' Close method always being called, and this is relatively easy to verify in the server code of the standard library. In case of the outgoing connections, the best way seems to be to try the net/http/httptrace library, and see how it works out.

Pending requests

The best solution for this is measuring the pending requests on a global LIFO queue (it's built to be cascadable), that protects the skipper instance.

aryszka commented 5 years ago

Update: we have metrics for incoming connections: https://opensource.zalando.com/skipper/operation/operation/#connection-metrics