Monitoring¶
HTTP Stats Endpoint¶
Requires --http-stats flag. Accessible from private networks only (loopback, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
Custom Network Access¶
To allow access from overlay/VPN networks (Tailscale, WireGuard, Netbird), use --stats-allow-net:
Repeatable — specify multiple times for multiple ranges. Both IPv4 and IPv6 CIDR notation supported.
Prometheus Metrics¶
Returns Prometheus exposition format on the same stats port. Includes per-secret metrics when labels are configured.
Available metrics include connection counts, per-secret connections, rejection counts, and IP ACL rejections.
DC Latency Probes¶
When enabled, teleproxy periodically probes all 5 Telegram DCs with a TCP handshake and exposes the results as a Prometheus histogram:
Metrics exposed:
| Metric | Type | Description |
|---|---|---|
teleproxy_dc_latency_seconds |
histogram | TCP handshake RTT per DC (labels: dc="1"..dc="5") |
teleproxy_dc_probe_failures_total |
counter | Failed probe attempts per DC |
teleproxy_dc_latency_last_seconds |
gauge | Most recent probe latency per DC |
The text /stats endpoint includes matching fields: dc_probe_interval, dcN_probe_latency_last, dcN_probe_latency_avg, dcN_probe_count, dcN_probe_failures.
Disabled by default. Set dc_probe_interval in the TOML config or use the DC_PROBE_INTERVAL environment variable in Docker.
Grafana Dashboard¶
Import the bundled dashboard into Grafana:
- Download
dashboards/teleproxy.jsonfrom the repository - In Grafana → Dashboards → Import → Upload JSON file
- Select your Prometheus datasource
The dashboard covers connections, per-secret usage, rejection rates, DC connectivity, and resource utilization.
Health Checks¶
Docker containers include built-in health monitoring via the stats endpoint. Check with: