Doku durchsuchen
Menü
Geändert am Auf GitHub bearbeiten

Server-API: health

Als Markdown kopieren

Diese Routen liegen auf der Server-API, Port 21114 (21121 in Docker). Sie nehmen einen API-Schlüssel in X-API-Key oder ein Anmelde-Token; siehe Die HTTP-API. Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.

Whether the server answers, and its runtime figures for monitoring.

GET /api/health

Check that the server answers.

Answers everyone, with the status and the version only.

On the server API, port 21114.

200: Done (application/json)

Field Type Required
status "ok" yes
version string yes
Error When
503 The server is not ready yet

GET /api/health/detail

Show the server's health with peer counts, relay and connection settings.

Uses the same access rules as /metrics. Callers on the server itself, addresses in METRICS_IP_ALLOWLIST and callers with the METRICS_TOKEN bearer token get in, as does everyone when METRICS_PUBLIC is set. Others need an API key or a sign-in token with metrics.view. Fields of parts that are not running are left out.

On the server API, port 21114. Needs metrics.view.

200: Done (application/json)

Field Type Required What it is
status "ok" yes
version string yes
peers_total integer yes Devices in the database
peers_online integer yes Devices the database marks online
uptime_seconds integer yes Seconds since the server started
tls boolean yes Whether a TLS certificate and key are set
peers_in_memory integer Devices registered with the ID server right now
peers_degraded integer
peers_critical integer
peers_udp integer
peers_tcp integer
peers_ws integer
relay_active_sessions integer
billing_pending_relays integer Relay sessions waiting to be billed
clock_synced boolean
connection object
connection.p2p_first boolean
connection.always_use_relay boolean
connection.p2p_fallback_ms integer
connection.same_nat_relay boolean
connection.allow_shared_nat_initiator boolean
connection.logged_in_only_initiator boolean
connection.operator_only_outbound boolean
connection.relay_servers array of string
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission

GET /api/server/stats

Show the server's runtime figures: memory, peers, relay and bandwidth.

Uses the same access rules as /metrics. Callers on the server itself, addresses in METRICS_IP_ALLOWLIST and callers with the METRICS_TOKEN bearer token get in, as does everyone when METRICS_PUBLIC is set. Others need an API key or a sign-in token with metrics.view. The relay, bandwidth and blocklist fields are there only when those parts run.

On the server API, port 21114. Needs metrics.view.

200: Done (application/json)

Field Type
version string
go_version string
os string
arch string
goroutines integer
memory_alloc_bytes number
memory_sys_bytes number
peers_total integer
peers_online integer
peers_in_memory integer
uptime_seconds integer
peers_online_live integer
peers_degraded integer
peers_critical integer
peers_udp integer
peers_tcp integer
peers_ws integer
peers_banned integer
peers_disabled integer
avg_uptime_seconds number
avg_beat_age_seconds number
total_registrations integer
total_expired integer
relay_active_sessions integer
relay_relayed_sessions integer
bandwidth_transferred_bytes integer
bandwidth_active_sessions integer
bandwidth_throttle_hits integer
blocklist_count integer
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission

Durchsucht Seiten, Abschnitte, Befehle und Einstellungen.