Health & System Endpoints
Liveness and readiness probes, billing, and the metrics endpoint on KubeMQ's management API, with a Kubernetes probe example.
These operational endpoints cover health checks, readiness, billing, and Prometheus
metrics on the management API port (:8080). They are not gated by the readiness guard
described on the Management API overview, so they are
available as soon as the HTTP server starts.
GET /health
Returns the process health as plain text. This is the liveness signal.
Response: text/plain
| Condition | HTTP status | Body |
|---|---|---|
| Healthy | 200 | healthy |
| Not healthy | 500 | not healthy |
GET /health
→ 200 OK
healthyUse this for a liveness probe or a health-indicator badge; poll every 5–10 seconds.
GET /ready
Returns the readiness state as a raw JSON HealthState object (no envelope). This is the
Kubernetes readiness probe endpoint.
Response: application/json
| Condition | HTTP status | Body |
|---|---|---|
| Ready | 200 | HealthState JSON |
| Not ready | 503 | HealthState JSON |
A node that is not ready answers 503, whether it is still starting up or already running. A probe treats any non-2xx as "not ready"; a check that compares the status code exactly should expect 503.
{
"is_healthy": true,
"is_ready": true,
"current_leadership_role": "leader"
}| Field | Type | Description |
|---|---|---|
is_healthy | boolean | Whether the process is healthy |
is_ready | boolean | Whether the node is ready to accept traffic |
current_leadership_role | string | The cluster leadership role: leader, follower, mixed (leads some shards), or standalone for a single node |
store_ack_policy | string | The next storage engine's acknowledgement policy, strict or fast; omitted on the legacy engine |
reason | string | Why the node is not ready, when the cause is one to act on rather than wait out; omitted otherwise |
Use this for a readiness probe and to display each node's cluster leadership role.
A clustered node also reports not ready when it has been unable to reach the cluster
coordinator over the internal forwarding network for more than ten seconds. Without this check the
node would look healthy while every consumer-group request sent to it waited minutes and failed.
In that state reason says so and names the nodes it can still reach:
{
"is_healthy": true,
"is_ready": false,
"current_leadership_role": "follower",
"store_ack_policy": "fast",
"reason": "this node has not reached the cluster coordinator over the internal forwarding network for 28s; nodes it can reach: kubemq-next-2:6800"
}The node recovers on its own when the link returns. The check applies only to clustered nodes on the next storage engine, and never to the coordinator itself; a rolling restart does not trip it, because a node that goes away is replaced as coordinator rather than waited for.
Kubernetes probes
Wire /health and /ready to the container's liveness and readiness probes on the
management API port (8080):
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5For full deployment settings, see Kubernetes configuration.
GET /billing
Returns a usage summary for the current node, wrapped in the standard response envelope.
Response: standard envelope with Billing data.
| Field | Type | Description |
|---|---|---|
hostname | string | Node hostname |
uptime | float64 | Uptime in seconds |
messages | int64 | Total messages processed |
volume | float64 | Total data volume in bytes |
last_message | int64 | Unix timestamp of the last message |
{
"error": false,
"error_string": "",
"data": {
"hostname": "kubemq-node-0",
"uptime": 3600,
"messages": 50000,
"volume": 1024000,
"last_message": 1709312400
}
}GET /metrics
Returns all registered metrics in Prometheus text exposition format. This is the endpoint Prometheus scrapes; it is not meant for direct UI consumption — use the snapshot endpoints for dashboard data instead.
Response: text/plain (Prometheus exposition format)
For the full metric catalog, labels, and PromQL examples, see Prometheus Metrics.
GET /kill
Disabled. Always returns HTTP 404 in plain text and does not use the standard envelope. Reserved — do not use.
GET /kill
→ 404 Not Found
{"message":"not found"}Was this page helpful?