Integration: Prometheus

Your Wall's State in Prometheus

Settings, Metrics makes a token, and from then on GET /metrics answers whoever sends it, in the text format that Prometheus and everything that reads its format understand: each machine's state, picture, temperature and health, and the wall's own.

What It Answers

MetricSays
qkvm_devices{state}How many tiles are in each state: online, no_signal, offline, auth, error, busy, connecting
qkvm_device_up{id,device,kind,group}1 while that device answers, 0 while it does not
qkvm_device_picture{...}1 while it shows a picture; for a server, while it is switched on
qkvm_device_last_seen_seconds{...}Seconds since it last answered
qkvm_device_temperature_celsius{...,sensor}How warm it is: the KVM itself (sensor="device"), or each sensor of a server
qkvm_server_healthy{...}1 while a server's management controller calls it healthy
qkvm_unlocked1 while qKVM can talk to its devices
qkvm_sessions, qkvm_devices_configured, qkvm_update_available, qkvm_info{version}, qkvm_start_time_secondsAbout qKVM itself
Here {...} stands for the labels of qkvm_device_up, as in the documentation.

Set It Up

  1. A tokenSettings, Metrics. It is shown once, and qKVM keeps only its hash.
  2. Scrape itmetrics_path: /metrics, with the token as the authorization credentials, and the wall as the target.
  3. By nameAn IP address, a name without a dot, or one ending in .local, .lan, .internal, .home.arpa or .ts.net. Any other name goes under allowed_hosts.
  4. Alert on itqkvm_unlocked at 0 after a restart with --locked-start: nothing is collected until somebody signs in.

Good to Know

The token
Reads the metrics and nothing else. A new one replaces it, and Switch off makes /metrics answer nobody.
Unattended
While metrics are on, qKVM goes on watching the devices after the last person has signed out, and after a restart.
JetKVM
A collector is nobody watching: a JetKVM not on screen is only asked whether it answers, so its one viewer is left to whoever wants it.
Health check
GET /healthz needs no token. It says that qKVM is running, which version, and whether it still waits for a sign-in after a restart.