I'm using an Nginx instance as load balancer for different location/endpoints (I am not tied to Nginx, so a different software load balancer (haproxy was suggested) would also be an option). Depending on the URL, the requests gets relayed to another ("backend") Nginx instance that handles the request or dispatches it further.
Is it possible retrieve stats about when the last request to a certain endpoint occurred and whether there's still an active connection to the handling backend server (websocket)? I looked at the ngx_http_stub_status_module, but the data one can get seems to be aggregated and not by backend server. The data should be processed programmatically, so I am not so much interested in charts, etc and I'd also like to avoid parsing log files, if possible (so perhaps connecting to a REST API or even a socket to get the monitor data would be great).
Anyway, any pointers are welcome.