Skip to content

Status Page

Public status page at schemastack.io/status showing real-time health of all SchemaStack services.

Data Flow

metadata-rest GET /api/status (checks all services internally)
  → CF Worker cron every 5 min (calls origin, writes to KV)
    → CF Worker GET /status (reads KV, returns JSON)
      → Website Status.tsx (fetches /status, renders)

Architecture

CF Worker (schemastack-deployment)

The existing origin-proxy worker (cloudflare/worker/) handles the status pipeline:

Cron trigger (*/5 * * * *):

  1. Calls ${ORIGIN_HOST}/api/status with X-Origin-Secret header
  2. On success: writes response to KV as status:current
  3. On failure: writes fallback snapshot (metadata-rest/consumer-worker = down, others = unknown)
  4. Appends compact entry to status:history (max 288 entries = 24h)

GET /status endpoint:

  • Reads status:current and status:history from KV
  • Returns JSON with Cache-Control: public, max-age=60 and CORS headers

KV Data Structure

status:current:

json
{
  "timestamp": "2026-03-12T14:30:00Z",
  "services": {
    "metadata-rest": { "status": "operational", "latencyMs": 42 },
    "consumer-worker": { "status": "operational", "latencyMs": 28 },
    "processor": { "status": "operational", "latencyMs": 156 },
    "workspace-api": { "status": "operational", "latencyMs": 38 },
    "postgres": { "status": "operational", "latencyMs": 12 },
    "rabbitmq": { "status": "operational", "latencyMs": 8 }
  }
}

status:history (compact, max 288 entries):

json
[
  {
    "t": "2026-03-12T14:30:00Z",
    "s": {
      "metadata-rest": "operational",
      "consumer-worker": "operational",
      "processor": "operational",
      "workspace-api": "operational",
      "postgres": "operational",
      "rabbitmq": "operational"
    }
  }
]

Worker /status Response

json
{
  "current": {
    /* status:current value */
  },
  "history": [
    /* status:history value */
  ]
}

Status values: "operational" | "degraded" | "down" | "unknown"

Free Tier Budget

  • 2 KV writes per cron invocation x 288/day = 576 writes/day (limit: 1,000)
  • KV reads: minimal (cached at edge for 60s)

Frontend (Status.tsx)

The component at projects/website/src/components/Status.tsx:

  • Fetches https://status.schemastack.io on mount and every 60s
  • Maps current.services to service cards with display names and icons (client-side mapping)
  • Maps history[].s[serviceKey] to the uptime timeline bars (288 data points = 24h)
  • Calculates uptime percentage from history (operational count / total x 100)
  • Shows loading spinner initially, "Unable to load status" on fetch errors
  • When all services report unknown, shows "Checking status..." state

Service Key Mapping

API KeyDisplay NameGroup
metadata-restAPICore Services
consumer-workerReal-time & FilesCore Services
processorBackground ProcessingCore Services
workspace-apiData APICore Services
postgresDatabase (Primary)Infrastructure
rabbitmqMessage QueueInfrastructure

Backend: GET /api/status (metadata-rest)

Not yet implemented. Needs to be added to the metadata-rest service.

This endpoint runs server-side and checks all Docker-internal services:

ServiceHealth Check
metadata-restSelf (always operational)
consumer-worker-http://...:8080/q/health/ready
processor-http://...:8082/actuator/health
workspace-api-http://...:8083/actuator/health
postgresJDBC SELECT 1 on port 5432
rabbitmqhttp://rabbitmq:15672/api/health/checks/alarms

Expected response format: same as the status:current KV structure above.

Blue/green logic: for services with blue/green deployments, check whichever instance is currently active. Report the active one's status.

Until this endpoint is implemented, the cron will receive a 404 and the status page will show unknown states for all services.

Deployment

One-time setup (CF Worker)

bash
cd schemastack-deployment/cloudflare/worker

# Create the KV namespace
wrangler kv namespace create STATUS_KV

# Update wrangler.toml with the returned namespace ID
# (replace PLACEHOLDER_CREATE_WITH_WRANGLER)

# Deploy
wrangler deploy

Verification

bash
# Trigger cron locally
wrangler dev --test-scheduled

# Test endpoint
curl http://localhost:8787/status

# Website dev
cd schemastack-fe && npm run dev
# Visit http://localhost:3000/status

SchemaStack Internal Developer Documentation