Status & observability

Health checks, usage statistics, access logs, request tracing and the panel's observability pages for running Spica in production.

Health checks

EndpointAuthUse for
GET /status/liveNoneLiveness probes. Answers {"status": "ok"} while the process is up.
GET /status/readyNoneReadiness probes. Answers {"status": "ok"} when the API can serve traffic.

The Helm chart uses /status/live for startup and liveness probes and /status/ready for readiness.

Usage statistics

GET /status (with status:index) reports usage per module:

JSON
[
  {"module": "bucket", "status": {"buckets": {"current": 3, "unit": "count"}, "bucketData": {"current": 6, "unit": "count"}}},
  {"module": "storage", "status": {"size": {"current": 0.03, "unit": "mb"}}},
  {"module": "api", "status": {"request": {"current": 180, "unit": "count"}, "uploaded": {"current": 0.04, "unit": "mb"}, "downloaded": {"current": 0.15, "unit": "mb"}}},
  {"module": "user", "status": {"users": {"current": 1, "unit": "count"}}}
]

GET /status/:module returns one module. API request counts and sizes are collected while --http-status-tracking is on (the default), and records expire after --common-log-lifespan.

The panel's home page shows the same numbers, including usage against configured limits and traffic over time.

The panel home page with resource overview, usage limits and traffic charts

Access logs

Log every HTTP request to stdout:

OptionDefaultDescription
--access-logsfalseTurn access logs on.
--access-logs-url-filter.*Only log URLs matching this regular expression.
--access-logs-statuscode-filter.*Only log status codes matching this regular expression, for example ^5.
--access-logs-proxy-request-id-headerx-request-idHeader whose value is logged as proxy_request_id. Empty disables it.

Each line ends with spica_request_id, spica_hop_id, spica_parent_hop_id, proxy_request_id, started_at and duration_ms. Every response carries an x-spica-request-id header, and requests that a function makes back to Spica share the same request id, so you can follow a request through functions.

Bucket observability

Observability in the panel lists every bucket with its document count and health, and opens the query profiler of a bucket to find slow queries. The data comes from GET /bucket/:bucketId/data/profile.

Bucket observability page listing buckets with entity counts and health

Logs of your code

Function logs are stored by Spica and can also go to stdout. See Function logs.

A production setup

  • Point your orchestrator's probes at /status/live and /status/ready.
  • Turn on access logs with a status code filter such as ^[45] and ship stdout to your log platform.
  • Send function worker logs to stdout with --function-worker-log-output=database,stdout.
  • Propagate your proxy's request id header and search logs by it.
  • Watch /status for growth in documents and storage.