Prometheus Metrics Endpoint Surge now provides a… — Surge TestFlight Feed — TG.ME

Prometheus Metrics Endpoint

Surge now provides a Prometheus-compatible metrics endpoint at GET /v1/metrics, making it easy to integrate Surge with Prometheus and Grafana for long-term monitoring and visualization. This is particularly useful for gateway deployments that run continuously.

The endpoint exposes cumulative traffic counters for each network interface and policy (surgeinterface_bytes_total and surge_policy_bytestotal), which can be combined with PromQL functions such as rate() for real-time throughput or increase() for traffic usage over any time window.

It also provides metrics for the Surge engine’s memory footprint (surgememorybytes), in-flight requests, DNS cache size, active unauthorized-access bans, uptime, and build information. The memory metric can be especially useful on iOS for monitoring Network Extension memory usage over time.

The metrics endpoint uses the same authentication mechanism as the rest of the Surge HTTP API. Since Prometheus does not send custom authentication headers by default, the API key can also be supplied through the x-key query parameter:

scrape_configs:
- job_name: surge
metrics_path: /v1/metrics
params:
x-key: ["<your-http-api-key>"]
static_configs:
- targets: ["192.168.1.1:6171"]
👍19❤1
August 10, 2026 5.4K 29