Skip to main content

GET health

A monitoring endpoint that checks Frappe and ClickHouse. It needs no login.

Endpoint​

GET /api/method/konsol.api.health

The decorator is @frappe.whitelist(allow_guest=True) with no verb restriction, so POST works too.

Authentication: none (allow_guest=True)

Response​

{
"message": {
"status": "ok",
"app": "konsol",
"clickhouse": {
"status": "healthy",
"clickhouse_reachable": true,
"recent_sync_failures": [],
"message": "All systems operational"
}
}
}

The top-level status comes from konsol.clickhouse.check_health:

statusMeaning
okFrappe is up and ClickHouse is healthy: SELECT 1 answered and no table has a recent sync failure
degradedClickHouse answered but one or more tables have recent sync failures (listed in clickhouse.recent_sync_failures)
downClickHouse did not answer (connection error, timeout or any other error; clickhouse.message says which)

The nested clickhouse object carries status (healthy / degraded / down), clickhouse_reachable (bool), recent_sync_failures (a list of {"table": ..., ...}) and a message.

Example​

curl http://localhost:8069/api/method/konsol.api.health

Usage​

Monitoring and uptime checks​

Point your monitor at this endpoint. A 200 with "status": "ok" means Frappe, the konsol app and ClickHouse are all up. Treat degraded as a warning (data may be stale) and down as critical.

Docker health check​

healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8069/api/method/konsol.api.health"]
interval: 30s
timeout: 5s
retries: 3

Notes​

  • Each call runs SELECT 1 on ClickHouse, so it is heavier than a plain web-server ping. A 30 s interval is fine; do not poll it many times a second.
  • The Excel add-in does not call this endpoint; its =K.PING() function is local to the add-in.
  • For stack-wide monitoring see Monitoring.