The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.
TL;DR
The API reports production health to incident.io; the public status page is hosted outside the application stack.
Public status page (incident.io)
Infrastructure index · Observability · Configuration
https://status.boxlite.ai is an incident.io-hosted status page. Nothing in
the stack serves it; the API feeds it. What depends on it in this repo:
- API status sync — the sync that keeps it honest (below)
apps/api/src/common/middleware/maintenance.middleware.ts— the 503 maintenance message points at itREADME.md— Getting Help links it
How the sync works
StatusSyncService
runs every 30s on one replica (Redis lock). Each tick it observes:
| Observation | Signal |
|---|---|
api |
in-process Postgres ping + Redis ping |
boxes-<region> |
runner fleet per shared region: any UNRESPONSIVE among schedulable, non-draining runners |
box-ingress-<region> |
GET <region.proxyUrl>/health over the public path |
Transitions are damped (3 consecutive bad ticks to fire ≈ 90s sustained, 2 good
ticks to resolve) and pushed as alert events —
POST /v2/alert_events/http/<source-id> with stable deduplication keys
<prefix>-<observation> (prefix defaults to boxlite-<stage>), body
{title, status: firing|resolved, deduplication_key, description, metadata}
where metadata = {component, region?, prefix, source: 'boxlite-status-sync'}.
After every completed tick it pings POST /v2/heartbeat/<id>/ping: if the API
dies, crons stop, or Redis is unreachable, the pings stop and incident.io
raises the alarm on its own.
Dedicated/custom regions never reach the page — they are org-scoped. Known v1 blind spots are documented on the service class.
One-time incident.io setup
Do these in order; the stage stays dark until the final step.
Create the page (Status pages → Create, public). Split it by region via sub-pages (catalog
Regiontype → one sub-page per shared region, a region selector in the header). Components:Dashboard,API,Docsshown on every page;BoxesandBox Ingressscoped to each region's sub-page. Adding a region later = one catalog entry + two components + extending the workflow mapping in step 6.Enable the uptime display (per-component uptime % + the
/uptimehistory view). It is computed from incidents' component impacts — i.e. fed by this sync; nothing else to wire.Custom domain: Settings → Custom domain →
status.boxlite.ai; add the CNAME it shows you in the Cloudflare dashboard for theboxlite.aizone (the zone is administered outside this repo, likego.boxlite.aiandsh.boxlite.ai— this is deliberately not an SST resource: the status page must not depend on a stack deploy). DNS-only unless incident.io's instructions say proxying is supported. Wait for their certificate check.Create the HTTP alert source (Alerts → Sources → HTTP). Note the
alert_source_config_idfrom its URL. Send one test event with the exact body shape above and bind the default attributes; mapmetadata.componentandmetadata.regionto catalog attributes.Create the heartbeat (On-call → Heartbeats): interval 2 minutes — four ticks, so one slow/skipped tick or a rolling deploy does not false-fire, while a dead reporter still alarms in ~2–3 minutes. Note its id, then curl-verify the ping path before arming — read the key without echo and feed the header through curl's config stream so it never reaches shell history or process arguments:
read -rs INCIDENT_IO_KEY # paste the key; no echo printf 'header = "Authorization: Bearer %s"\n' "$INCIDENT_IO_KEY" \ | curl --fail --show-error -X POST https://api.incident.io/v2/heartbeat/<id>/ping -K -(a wrong path announces itself as an immediate heartbeat alarm).
Alert route + workflow: route the source's alerts to auto-create an incident per deduplication key (grouping window ≥ 5 min; auto-resolve the incident when its alerts resolve), and an auto-publishing workflow that maps
metadata.component+metadata.regionto the matching page component's impact, publishing on create and resolving with the incident.API key: create one scoped to create alert events and send heartbeat pings only — no incident, catalog, or status-page write scopes.
Arm the production stage: put
INCIDENT_IO_ALERT_SOURCE_CONFIG_IDand optionallyINCIDENT_IO_HEARTBEAT_IDin itsdeploygroup. WriteINCIDENT_IO_TOKENthrough secret stdin to theapigroup, update the deployment digest, then preview/apply the API configuration. With an alert source configured, mdeploy derivesSTATUS_SYNC_ENABLEDfrom token availability inapi-environment.ts.npm run mstage env set -- INCIDENT_IO_TOKEN --stage prod --confirm < /secure/path/incident-token.txt npm run mstage env set -- --stage prod --digest --confirm npm run mstage env digest -- --stage prod
Go-live checklist
status.boxlite.airesolves with a valid certificate and renders the page- Region sub-pages navigate;
Dashboard/API/Docsappear on each - Post a synthetic
firingevent and then a matchingresolvedevent: the page marks the intended region'sBox Ingressaffected and clears it on resolution - The heartbeat shows healthy while the API runs; validate a missed-heartbeat alarm using a controlled test reporter or an approved maintenance window
- The README link works
Operational notes
- Planned maintenance:
MAINTENANCE_MODE/DISABLE_CRON_JOBSstop every cron (app.service.ts), including this one — the heartbeat then alarms, by design. Schedule an incident.io maintenance window first so the page says "maintenance", not "outage". - First enablement emits one
resolvedseed per component — harmless no-ops that establish the dedup keys. - Dev stages stay dark: never set
INCIDENT_IO_TOKENthere. The public page describes production only. - Removing a region (or clearing its proxyUrl, or emptying its fleet) auto-resolves its alert: the sync retires components its evaluators stop returning. Still remove the retired page components in incident.io.
- Token rotation: set the new secret and redeploy; until then failed sends retry twice a minute per component and are visible in the API logs.
- If external uptime probing is ever added,
GET /api/healthis the only publicly pollable endpoint, and it sits behind the anonymous rate limit (RATE_LIMIT_ANONYMOUS_*), whose budget is shared per source IP across all anonymous routes — size probe intervals against the production limits.