JL
EN
Docs Home
Menu
Guides

Metrics And Health

Monitor service liveness and write-path state with health and stats endpoints.

guide jsonlog

Metrics And Health

Purpose: validate service availability and inspect high-level ingestion buffer state.

Preconditions

  • JsonLog service is reachable.
  • For query storage metrics, use authenticated /query/stats.

API/Script Flow

  1. Liveness check:
    • GET /health should return {"status":"ok"}.
  2. Write-path stats:
    • GET /stats returns active account buffer metrics.
  3. Account storage stats:
    • GET /query/stats with Bearer auth returns uploaded file aggregates.

HTTP/curl Flow

JSONLOG_BASE_URL="http://localhost:3002"
ACCESS_TOKEN="<account_scoped_token>"

curl -sS "${JSONLOG_BASE_URL}/health"

curl -sS "${JSONLOG_BASE_URL}/stats"

curl -sS "${JSONLOG_BASE_URL}/query/stats" \
  -H "authorization: Bearer ${ACCESS_TOKEN}"

Validation

  • /health returns HTTP 200 and status payload.
  • /stats returns HTTP 200 with write-path statistics object.
  • /query/stats returns HTTP 401 without auth and 200 with valid auth.