Skip to content
Prometheus metrics endpoint Scrape your whole fleet's server metrics (CPU, memory, swap, disk per mount, load, network, uptime, online state, agent version) and uptime-monitor status into Prometheus or Grafana with one read-only API token — no exporter on the boxes.

Prometheus metrics endpoint

MZPanel already collects a heartbeat from every server’s agent (about every 10 seconds) and the result of every uptime check. GET /v1/api/metrics/prometheus hands that data to your own monitoring stack in the Prometheus text format, so Prometheus, Grafana Agent / Alloy, VictoriaMetrics or any other scraper can pull the whole fleet from one URL. Nothing is installed on the boxes and a scrape never reaches an agent: it reads what the control plane already holds. It works on every plan.

  1. Open Advanced → Developer (/developer) and click Create token.
  2. Label it (e.g. Prometheus scraper) and pick the Read only ability. Read is all the endpoint needs.
  3. Optional: under Servers, choose specific servers to expose only those. Leave All servers if you also want the uptime-monitor metrics (see What you get).
  4. Optional but recommended: fill Allowed IPs with your Prometheus server’s public address (one address or CIDR block per line), so the token is useless anywhere else.
  5. Click Create token and copy the mzmcp_… value (it is shown once).
  6. Add a scrape job to your Prometheus config:
scrape_configs:
- job_name: mzpanel
scheme: https
metrics_path: /v1/api/metrics/prometheus
scrape_interval: 60s
authorization:
type: Bearer
credentials_file: /etc/prometheus/mzpanel.token # the mzmcp_… value
static_configs:
- targets: ['api.mzpanel.com']

Reload Prometheus and check Status → Targets: the mzpanel job should be UP. To test by hand:

Terminal window
curl -s https://api.mzpanel.com/v1/api/metrics/prometheus \
-H "Authorization: Bearer mzmcp_YOUR_TOKEN" | head -20

Every server sample carries the labels server_id (the server UUID) and server (its name). Values are the agent’s last heartbeat; when an agent is offline its last values stay and mzpanel_server_online drops to 0.

MetricMeaning
mzpanel_server_info{agent_version}Always 1; carries the agent version
mzpanel_server_online1 while the agent is connected, 0 otherwise
mzpanel_server_last_seen_timestamp_secondsUnix time of the last heartbeat
mzpanel_server_cpu_usage_percent, mzpanel_server_cpu_coresCPU usage (all cores) and core count
mzpanel_server_memory_used_bytes, mzpanel_server_memory_total_bytesMemory
mzpanel_server_swap_used_bytes, mzpanel_server_swap_total_bytesSwap
mzpanel_server_disk_used_bytes{mount}, mzpanel_server_disk_total_bytes{mount}Disk per mount point (/ from the heartbeat, other mounts from the storage inventory, refreshed every few minutes)
mzpanel_server_load1, mzpanel_server_load5, mzpanel_server_load15Load averages
mzpanel_server_network_receive_bytes_per_second, mzpanel_server_network_transmit_bytes_per_secondNetwork rate over the last heartbeat interval
mzpanel_server_uptime_secondsSeconds since boot
mzpanel_server_processesRunning processes
mzpanel_uptime_monitor_up{monitor_id,monitor,type,target}1 up, 0 down; absent while a monitor is paused or has no verdict yet
mzpanel_uptime_monitor_paused1 when the monitor is paused
mzpanel_uptime_monitor_response_time_secondsResponse time of the last check
mzpanel_uptime_monitor_last_check_timestamp_secondsUnix time of the last check
mzpanel_scrape_timestamp_secondsWhen this response was generated

A metric the agent did not report (an older agent, a box without swap) is left out rather than sent as 0.

Which servers appear. Agent-managed servers the token can see: its server allowlist (if any), narrowed by the team role and site grants of the user who minted it. Agentless (SSH-only) servers have no heartbeat and are not listed. Uptime monitors are workspace-wide, so they appear only for a token without a server allowlist whose owner can see the whole workspace.

groups:
- name: mzpanel
rules:
- alert: MZPanelServerOffline
expr: mzpanel_server_online == 0
for: 5m
- alert: MZPanelDiskAlmostFull
expr: mzpanel_server_disk_used_bytes / mzpanel_server_disk_total_bytes > 0.9
for: 15m
- alert: MZPanelMonitorDown
expr: mzpanel_uptime_monitor_up == 0
for: 2m
  • Scrape every 30–60 s. The heartbeat arrives about every 10 s, so faster scrapes add nothing. Each scrape counts as one request against the token’s per-minute rate limit.
  • 401 unauthorized: the Authorization: Bearer mzmcp_… header is missing, or the token is revoked or expired.
  • 403 token_ip_denied: the token has an Allowed IPs list and the scraper’s address is not on it. The message names the address the request came from; add it on the Developer page (edit the token).
  • Metrics look stale for one server: check mzpanel_server_online and mzpanel_server_last_seen_timestamp_seconds; an offline agent keeps its last values.
  • No mzpanel_uptime_monitor_* series: the token has a server allowlist, or you have no monitors yet.