Skip to content
Open Kaisar App ↗

Legacy ZeroNode, Provider or KaiNode user? Your rewards are preserved.Legacy user?Check what you haveCheck your rewards

Metrics and health checks

Applies to Kaisar Node CLI, Docker and Kubernetes · updated Nov 20, 2026 · 4 min read

Draft · pending reviewThis guide is a draft and may change.

kaisar run can serve Prometheus metrics and health checks for your own monitoring. It is off by default: without --metrics-bind, no port is opened.

The endpoint only describes this machine. It never contains the node key, the node ID, the hardware fingerprint, a wallet, an IP address or task IDs.

Turn it on

  1. Start the node with a local address:
kaisar run --metrics-bind 127.0.0.1:9464
  1. Check it from the same machine:
curl -s http://127.0.0.1:9464/metrics
Turn it on
PathTokenAnswers
/metricsRequired when a token is setPrometheus text format
/healthzNeverOK while the node keeps reporting (within 120 seconds); always OK while linking
/readyzNeverOK when linked and the last heartbeat succeeded

/healthz and /readyz hold no numbers. The endpoint accepts at most 8 connections at once and allows 2 seconds per request: give probes a timeout of 3 seconds or more.

Where it may listen

Where it may listen
AddressAllowed
127.0.0.1 (this machine)Yes
Private address (10.x, 172.16–31.x, 192.168.x, 100.64.x, IPv6 fc00::/7)Only with a token file
Public address, 0.0.0.0, ::, link-localNever: the node exits with error KN-2301

A busy port, or a missing or short token file, stops the node with error KN-2302.

Use a token

  1. Create a token file of at least 32 characters, readable by the node user:
openssl rand -hex 32 > kaisar-metrics.token
  1. Start the node on a private address with the token file:
kaisar run --metrics-bind <private ip>:9464 --metrics-token-file kaisar-metrics.token
  1. Point Prometheus at it with the same token:
scrape_configs:
  - job_name: kaisar-node
    scrape_interval: 30s
    authorization:
      credentials_file: /etc/prometheus/kaisar-metrics.token
    static_configs:
      - targets: ["<private ip>:9464"]

The same settings work as environment variables: KAISAR_METRICS_BIND and KAISAR_METRICS_TOKEN_FILE.

Metrics

Every name starts with kaisar_node_. Names stay stable; if one is renamed, both names are served for two releases.

Metrics
MetricTypeMeaning
kaisar_node_build_infogaugeAlways 1; labels version, runtime
kaisar_node_uptime_secondsgaugeSeconds since kaisar run started
kaisar_node_linkedgauge1 when this machine is linked
kaisar_node_onlinegauge1 when the network sees it online
kaisar_node_stategauge1 for the current state: starting, online, paused, not_open, offline
kaisar_node_owner_pausedgauge1 when paused from Kaisar App
kaisar_node_heartbeats_totalcounterHeartbeats sent
kaisar_node_last_heartbeat_timestamp_secondsgaugeTime of the last successful heartbeat
kaisar_node_tasks_totalcounterTasks by role (provider, checker) and result (leased, committed, submitted, failed, released, skipped, dropped)
kaisar_node_task_errors_totalcounterTask errors
kaisar_node_lease_extensions_totalcounterTask leases extended
kaisar_node_task_runninggauge1 while a task runs
kaisar_node_task_queue_depthgaugeTasks this machine holds
kaisar_node_pending_resultsgaugeResults waiting to be submitted

The CLI does not report CPU or GPU usage yet; use your usual node exporter for that.

Example alerts

groups:
  - name: kaisar-node
    rules:
      - alert: KaisarNodeOffline
        expr: kaisar_node_state{state="offline"} == 1
        for: 5m
      - alert: KaisarNodeTasksFailing
        expr: increase(kaisar_node_tasks_total{result=~"failed|dropped"}[24h]) >= 3
      - alert: KaisarNodeNotOpen
        expr: kaisar_node_state{state="not_open"} == 1

Docker

Inside a container, 127.0.0.1 is the container itself, so a published port cannot reach it. Give the container a fixed private address on its own network, listen there with a token, and publish the port to the host only:

services:
  kaisar-node:
    environment:
      KAISAR_METRICS_BIND: 172.30.94.10:9464
      KAISAR_METRICS_TOKEN_FILE: /run/secrets/kaisar-metrics.token
    volumes:
      - ./kaisar-metrics.token:/run/secrets/kaisar-metrics.token:ro
    ports: ["127.0.0.1:9464:9464"]
    networks:
      kaisar: { ipv4_address: 172.30.94.10 }

networks:
  kaisar:
    ipam: { config: [{ subnet: 172.30.94.0/24 }] }

Add these lines to the Compose file from Run in Docker. The token file must be readable by UID 65532.

Kubernetes

  1. Create the token Secret:
kubectl -n kaisar create secret generic kaisar-metrics --from-literal=token=$(openssl rand -hex 32)
  1. Turn metrics on in values.yaml, then helm upgrade:
metrics:
  enabled: true
  token: { existingSecret: kaisar-metrics }
  serviceMonitor: { enabled: true }
  allowFrom:
    - namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: monitoring } }

The pod listens on its own IP on port 9464 behind a ClusterIP Service, never a NodePort or LoadBalancer. The ServiceMonitor needs the Prometheus Operator and the token Secret in the same namespace. Only the sources in allowFrom can scrape.

  • IPv4 pods only. On an IPv6 or IPv6-first dual-stack cluster the pod address is refused (error KN-2301); metrics through the chart are not supported there yet.
  • Strict network plugins. Probes come from the server's own IP. If your plugin blocks traffic from the host (for example Cilium with policy-enforcement: always), allow it to the metrics port, or the liveness probe fails and the pod restarts.