TGViewer
Surge TestFlight Feed Surge TestFlight Feed @surgetestflightfeed · 12.9K subscribers
Post #397 6.03K
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
More from @surgetestflightfeed
  1. Sep 25, 2026A new guide has been added to the Surge Knowledge Base, covering how to remotely manage a…
  2. Sep 14, 2026Beta Updates - A category parameter has been added to policy groups for grouped display. I…
  3. Sep 14, 2026Surge Mac 6.9.1 & Surge iOS 5.22.1 are now available. New Features - [iOS] Policy group wi…
  4. Sep 1, 2026* [Host] domain aliases can specify a dedicated DNS server. * Updated the IPv6 fake-IP ran…
  5. Sep 1, 2026Surge iOS 5.22.0 is now available on the App Store. New Features * Added a full-featured T…
  6. Sep 1, 2026Surge Mac 6.9.0 is Now Available * MASQUE & HTTP/3 — Added MASQUE proxy support with HTTP/…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →