You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dstack-gateway.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,3 +88,49 @@ insecure_no_auth = false
88
88
The admin server is fail-closed: if it is enabled with no `admin_token` and no `htpasswd_file`, and `insecure_no_auth` is `false`, it refuses to start rather than exposing an unauthenticated admin API.
89
89
90
90
Clients authenticate by sending `Authorization: Bearer <token>` or the `X-Admin-Token: <token>` header.
91
+
92
+
## Metrics
93
+
94
+
The admin server exposes Prometheus metrics at `GET /metrics`. It is part of the
95
+
admin API, so it is only reachable when `core.admin.enabled` is true and it
96
+
requires the same credentials — unless `insecure_no_auth` is set, which exposes
97
+
it along with the rest of the admin API. The series name domains, node ids and
98
+
instance counts, which is topology that should not be readable without
99
+
authentication.
100
+
101
+
```yaml
102
+
scrape_configs:
103
+
- job_name: dstack-gateway
104
+
static_configs:
105
+
- targets: ["<core.admin.address>"]
106
+
authorization:
107
+
credentials: "<the admin token>"
108
+
```
109
+
110
+
### Cluster-scoped vs node-local series
111
+
112
+
`dstack_gateway_cluster_*` describes replicated state: every node in the cluster
113
+
reports the same value, so summing across targets multiplies it by the number of
114
+
nodes. Everything else describes what one process did and sums normally.
115
+
116
+
```promql
117
+
# Instances in the routing table — replicated, so take one node's view
118
+
max(dstack_gateway_cluster_instances)
119
+
120
+
# Connections across the fleet — node-local, so add them up
121
+
sum(dstack_gateway_connections)
122
+
123
+
# Nodes disagreeing about who is up: this is the replication-lag signal
| `dstack_gateway_wg_reconfigure_failures_total` | The gateway could not push a WireGuard config: it failed to render, failed to write, or `wg syncconf` rejected the whole file over one bad peer stanza. Routing updates have stopped reaching the data plane while the gateway still looks healthy. |
132
+
| `dstack_gateway_kv_decode_failures_total` | A replicated record that fails to decode is skipped, which makes the CVM behind it silently unroutable. Labelled by key prefix. Alert on `> 0`; the magnitude counts how often a bad record was *read*, not how many are bad, so do not read it as a severity. |
133
+
| `dstack_gateway_kv_peer_buffered_logs` | Entries still buffered for a peer. Sustained growth means that peer stopped acknowledging and the two nodes are drifting apart. |
134
+
| `dstack_gateway_cluster_cert_not_after_seconds` | Certificate expiry per domain; alert on `- time()` falling under the renewal window. Capped at 256 series — compare `dstack_gateway_cluster_cert_domains` to see whether the cap was hit. |
135
+
| `dstack_gateway_kv_persist_failures_total` | Periodic snapshots are failing, so a restart replays a growing WAL. |
136
+
| `dstack_gateway_kv_persist_failures_total` | Periodic snapshots are failing, so a restart replays a growing WAL. |
0 commit comments