nginxinc/nginx-prometheus-exporter

Support for ws_stub_status (websocket) [failed to parse response body "WebSocket connections]

willianccs opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
I'm using websocket and export the stub_status for these connections using a custom module.
The output is:

❯ curl -k https://localhost/ws_status
WebSocket connections: 0
client websocket frames  | client websocket payload | client tcp data
0 0 0
upstream websocket frames  | upstream websocket payload | upstream tcp data
0 0 0

But the during the start of exporter appears this error:

Could not create Nginx Client: failed to parse response body "WebSocket connections: 0\nclient websocket frames  | client websocket payload | client tcp data\n0 0 0\nupstream websocket frames  | upstream websocket payload | upstream tcp data\n0 0 0\n": invalid input "WebSocket connections: 0\nclient websocket frames  | client websocket payload | client tcp data\n0 0 0\nupstream websocket frames  | upstream websocket payload | upstream tcp data\n0 0 0\n"

Describe the solution you'd like
Expect to parse the values to show like HTTP (stub_status):

❯ curl -k https://localhost/basic_status
Active connections: 2 
server accepts handled requests
 61 61 60 
Reading: 0 Writing: 1 Waiting: 1

❯ curl http://localhost:9113/metrics 
# HELP nginx_connections_accepted Accepted client connections
# TYPE nginx_connections_accepted counter
nginx_connections_accepted{business="stasco",env="dev-local",protocol="http"} 109
# HELP nginx_connections_active Active client connections
# TYPE nginx_connections_active gauge
nginx_connections_active{business="stasco",env="dev-local",protocol="http"} 1
# HELP nginx_connections_handled Handled client connections
# TYPE nginx_connections_handled counter
nginx_connections_handled{business="stasco",env="dev-local",protocol="http"} 109
# HELP nginx_connections_reading Connections where NGINX is reading the request header
# TYPE nginx_connections_reading gauge
nginx_connections_reading{business="stasco",env="dev-local",protocol="http"} 0
# HELP nginx_connections_waiting Idle client connections
# TYPE nginx_connections_waiting gauge
nginx_connections_waiting{business="stasco",env="dev-local",protocol="http"} 0
# HELP nginx_connections_writing Connections where NGINX is writing the response back to the client
# TYPE nginx_connections_writing gauge
nginx_connections_writing{business="stasco",env="dev-local",protocol="http"} 1
# HELP nginx_http_requests_total Total http requests
# TYPE nginx_http_requests_total counter
nginx_http_requests_total{business="stasco",env="dev-local",protocol="http"} 84

Maybe with prefix nginx_websocket_ instead of nginx_http_ .

Additional context
The custom module used to export ws_status: https://github.com/Refinitiv/ngx_http_websocket_stat_module

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.

This issue was closed because it has been stalled for 10 days with no activity.