Retrieving metrics from Relay Server

Relay Server serves these metrics produced by Prometheus from a Unix socket.

To retrieve metrics from the Relay Server's Unix socket, you can use the curl command to make a request to the following endpoint: http://localhost/metrics on the Unix socket /var/run/Binalyze.AIR.Relay.sock. Here's an example command:

sudo curl --unix-socket /var/run/Binalyze.AIR.Relay.sock http://localhost/metrics

Executing this command will provide you with a response containing various metrics related to the Relay Server. The response will include information such as the number of active connections, request duration, request errors, reload count, and more.

Please note that you need to run this command on the same system where the Relay Server is running, as it communicates via the Unix socket.

Here's a sample response:

# HELP air_relay_info Information about the Relay Server environment.
# TYPE air_relay_info gauge
air_relay_info{arch="aarch64", build_time="2023-06-14T07:22:01", commit="f064c83645e1901d421714b8bd1dbec274425551", goarch="arm64", goos="linux", hostname="halilonay.ubuntu", os="Ubuntu 22.04.2 LTS (Jammy Jellyfish)", version="2.23.0"} 1
# HELP air_relay_proxy_active_connections Number of active connections to the Relay Server.
# TYPE air_relay_proxy_active_connections gauge
air_relay_proxy_active_connections 0
# HELP air_relay_proxy_request_duration_seconds Duration of each request handled by the Relay Server.
# TYPE air_relay_proxy_request_duration_seconds histogram
air_relay_proxy_request_duration_seconds_bucket{le="0.005"} 0
air_relay_proxy_request_duration_seconds_bucket{le="0.01"} 0
air_relay_proxy_request_duration_seconds_bucket{le="0.025"} 0
air_relay_proxy_request_duration_seconds_bucket{le="0.05"} 0
air_relay_proxy_request_duration_seconds_bucket{le="0.1"} 0
air_relay_proxy_request_duration_seconds_bucket{le="0.25"} 1
air_relay_proxy_request_duration_seconds_bucket{le="0.5"} 1
air_relay_proxy_request_duration_seconds_bucket{le="1"} 1
air_relay_proxy_request_duration_seconds_bucket{le="2.5"} 1
air_relay_proxy_request_duration_seconds_bucket{le="5"} 1
air_relay_proxy_request_duration_seconds_bucket{le="10"} 1
air_relay_proxy_request_duration_seconds_bucket{le="+Inf"} 1
air_relay_proxy_request_duration_seconds_sum 0.149310392
air_relay_proxy_request_duration_seconds_count 1
# HELP air_relay_proxy_request_errors_total Total number of request errors encountered by the Relay Server.
# TYPE air_relay_proxy_request_errors_total counter
air_relay_proxy_request_errors_total 1
# HELP air_relay_proxy_requests_total Total number of requests received by the Relay Server.
# TYPE air_relay_proxy_requests_total counter
air_relay_proxy_requests_total 1
# HELP air_relay_reload_count Number of times the Relay Server has been reloaded.
# TYPE air_relay_reload_count counter
air_relay_reload_count 0
# ...

These metrics provide insights into the Relay Server's performance, resource utilization, and various other statistics related to its operations.

Last updated