Skip to main content
← Back to list
01Issue
FeatureTriagedSwamp Club
Assigneesstack72

Relationships

#1642 Docs: document health monitoring endpoints for swamp serve

Opened by stack72 · 8/13/2026

Context

PR #2139 (swamp-club#1613) adds three new authenticated HTTP endpoints to swamp serve for per-node health monitoring. The manual at content/manual/reference/swamp-serve/rest-api.md needs to document these.

Endpoints to Document

GET /api/v1/health — Health Snapshot

Returns a comprehensive point-in-time JSON snapshot of node health:

  • Instance identity: instanceId, deployment mode, uptime, readiness state
  • Active runs: run IDs, kinds (workflow-run/method-run), resource names, durations, principals
  • Throughput metrics: sliding-window (5 min) counters — completions, failures, cancellations, throughput/min, latency percentiles (P50/P95/P99)
  • Workers: name, status (idle/busy/unverified/draining), connected state, capacity, active dispatch count, platform
  • Scheduling: enabled state, schedule entries with cron expressions and next run times
  • Webhooks: registered routes, target workflows, verification schemes
  • Component health: datastore (reachability + latency), vault (availability) — each reports healthy/unhealthy, message, latency, details

Auth: Bearer [REDACTED-SECRET-1] + admin authorization (same as /api/v1/cancel).

GET /api/v1/health/stream — SSE Health Stream

Server-Sent Events stream that pushes health snapshots at a configurable interval.

  • Query param ?interval=<ms> controls push frequency (default 5000ms, min 1000, max 60000)
  • Supports Last-Event-ID header for resumable connections
  • SSE format: id: <n>\nevent: health\ndata: <json>\n\n
  • Sends initial snapshot immediately on connect, then at interval
  • Includes X-Accel-Buffering: no header for nginx reverse proxy compatibility

Auth: Same bearer token + admin auth.

GET /internal/runs — Full Run History

Returns all run records from the SQLite-backed RunTrackerStore, including completed, failed, and cancelled runs with full metadata.

  • Disabled by default — requires --enable-internal-api flag (or enable-internal-api: true in serve config, or SWAMP_ENABLE_INTERNAL_API=true env var)
  • Returns 404 when the flag is not set

Auth: Same bearer token + admin auth when enabled.

Authentication Setup

Document how to obtain and use a token:

# 1. Mint a server token
swamp access token mint health-monitor --principal user:monitoring

# 2. Grant admin access
swamp access grant create --subject user:monitoring --allow admin --on "access:*"

# 3. Use it
curl -H "Authorization: Bearer health-monitor.<secret>" https://serve:9090/api/v1/health

In OAuth mode, principals listed in --admins already have admin access — any server token minted for them works without a separate grant.

Where to Document

  • content/manual/reference/swamp-serve/rest-api.md — add endpoint reference
  • content/manual/how-to/swamp-serve/ — consider a how-to guide for setting up health monitoring dashboards
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW

Triaged

8/14/2026, 1:46:45 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/14/2026, 1:45:20 AM

Sign in to post a ripple.