Skip to content

Spillway Admin API ​

Experimental Alpha

Spillway is an experimental alpha. Its configuration, behavior and storage formats may change in future releases.

The admin API is a separate HTTP/1.1 listener on admin.listen (default :8081). It follows inbound.mode: plain HTTP in internal mode, and TLS with client certificates in mtls mode. It acts on the instance that receives the request; only pause, resume and connection-cap are shared with other instances.

Reaching the Admin API ​

The examples on this page and in the SOPs call spillway_admin, a shell function standing for curl with the right connection settings, and $ADMIN, the listener's URL. Define them once per shell.

Inside DeltaFi's Compose stack (internal mode), the listener is reachable only on the deltafi Docker network, so curl runs in a throwaway container on it:

bash
ADMIN=http://deltafi-spillway:8081
spillway_admin() { docker run --rm --network deltafi curlimages/curl -sS "$@"; }

An airgapped site uses any image with curl that it has loaded in place of curlimages/curl.

Standalone (mtls mode), present an operator certificate:

bash
ADMIN=https://spillway.example:8444
spillway_admin() { curl -sS --cert ops.crt --key ops.key --cacert ca.crt "$@"; }

The standalone stack publishes the admin listener on SPILLWAY_ADMIN_PORT, 8444 by default. ops.crt must chain to inbound.tls.clientCA, and one of its SANs must be in admin.operatorSANs. ca.crt is the CA that issued Spillway's server certificate.

Access and Actor ​

ModeWho may call /admin/Recorded actor
internalAnything that can reach the listener; there is no authenticationinternal:<client address>
mtlsA client whose verified certificate has a DNS SAN, or failing that a URI SAN, listed in admin.operatorSANs. No certificate gets 401 client certificate required; a certificate with no listed SAN gets 403 operator not allowedThe first listed SAN

Every mutation is logged with its actor. Pause, resume, connection cap, force-demote, its end and volume reset each write a control audit row; DLQ replays and purges write a row per file.

Errors are short text bodies beginning spillway: , such as spillway: unknown channel. Successful answers are JSON.

Health ​

EndpointAnswer
GET /healthz200 ok while the process serves
GET /readyz200 ok once the volume lock is held, the committer runs and the object store probe has a verdict (passed, or store unreachable); 503 not ready before that and shutting down once shutdown begins

Neither needs a client certificate in mtls mode.

Endpoints ​

EndpointPurpose
GET /admin/channelsStatus of every channel on this instance, with the instance's projections
GET /admin/channels/<id>Status of one channel
POST /admin/channels/<id>/pause, /resumeStop or restart delivery for the channel, on every instance
POST /admin/channels/<id>/connection-capSet or clear a temporary connection cap, on every instance
POST, DELETE /admin/channels/<id>/force-demoteStart or end a force-demote of the channel on this instance
POST, DELETE /admin/force-demoteStart or end a force-demote of every channel on this instance
POST /admin/channels/<id>/dlq/replayReturn the channel's DLQ to delivery
POST /admin/channels/<id>/dlq/purge?before=<ms>Purge DLQ entries received at or before a time, in two steps
POST /admin/channels/<id>/dlq/purge with {"dids": [...]}Purge the named DIDs' DLQ entries in one step
GET /admin/dids/<did>Find where a DID is on this instance or in S3
POST /admin/volume/resetClear the volume's degraded flag after the volume is checked, and re-queue entries stranded while degraded

An <id> that is not a configured channel gets 404 unknown channel.

While the local volume is degraded, every mutation except volume/reset and the force-demote calls is refused with 503 volume degraded, because its audit rows cannot be recorded; nothing is changed. A force-demote, or its end, is applied without its control row and logged at warn with the caller.

Channel Status ​

bash
spillway_admin "$ADMIN/admin/channels"
spillway_admin "$ADMIN/admin/channels/consumer-a"

GET /admin/channels answers {"channels": [...], "timeToHardSeconds": …, "demotionMarginBytesPerSecond": …, "promoteStreamBytesPerSecond": …, "uploadSlotBytesPerSecond": …}; GET /admin/channels/<id> answers one channel's object:

json
{
  "id": "consumer-a",
  "breaker": "closed",
  "paused": false,
  "connectionCap": null,
  "limit": 8,
  "inUse": 3,
  "backlog": {
    "local": { "files": 1200, "bytes": 245760000 },
    "retry": { "files": 4, "bytes": 819200 },
    "dlq": { "files": 0, "bytes": 0 },
    "s3": { "files": 0, "bytes": 0 }
  },
  "dlqCounted": true,
  "oldestAgeSeconds": 412.5,
  "forceDemote": false,
  "promotionBlocked": false,
  "evacuated": false,
  "projections": {
    "producerBytesPerSecond": 1048576,
    "capacityBytesPerSecond": 2097152,
    "estimator": "littles",
    "mismatchRatio": 0.5,
    "catchupSeconds": 234.3
  }
}
FieldMeaning
breakerclosed, open or paused
paused, connectionCapThe channel's control state; connectionCap is null with no cap
limit, inUseThe adaptive connection limit; slots busy
backlogFiles and bytes (allocated blocks) by tier. The s3 files count only segments whose footer has been read. On a degraded volume, local and retry leave out the files a force-demote has evacuated, which stay on disk until a volume reset or a restart
dlqCountedfalse while the channel's DLQ is first counted after startup, or while a replay or purge started before the count finished runs; its dlq tally is 0 until then
oldestAgeSecondsOldest undelivered entry across the local, retry and S3 tiers, as the gauge's all tier
forceDemoteA force-demote of the channel is on
promotionBlockedThe mover's last pass found the channel unable to promote
evacuatedA force-demote on a degraded volume has uploaded every one of the channel's local files
projectionsOmitted until the channel's projections are known. estimator is saturated or littles. mismatchRatio and catchupSeconds are omitted while the channel is paused; an infinite value is null

At the top level, timeToHardSeconds is the instance's projected time to the hard limit, demotionMarginBytesPerSecond its demotion margin, and promoteStreamBytesPerSecond and uploadSlotBytesPerSecond what one promote stream and one upload slot carry, as the gauges of the same names report them. Each is omitted until known, and an infinite time is null.

Pause, Resume and Connection Cap ​

bash
spillway_admin -X POST "$ADMIN/admin/channels/consumer-a/pause"
spillway_admin -X POST "$ADMIN/admin/channels/consumer-a/resume"
spillway_admin -X POST -H 'Content-Type: application/json' -d '{"cap": 4}' "$ADMIN/admin/channels/consumer-a/connection-cap"
spillway_admin -X POST -H 'Content-Type: application/json' -d '{"cap": 0}' "$ADMIN/admin/channels/consumer-a/connection-cap"

Each answers 200 with the control state written:

json
{ "v": 1, "paused": true, "connectionCap": null, "updatedBy": "internal:172.18.0.9:41522", "updatedMs": 1763300000000 }
  • A paused channel delivers nothing and sends no probes; its arrivals spill to the local volume. Under storage pressure a paused channel's data demotes first.
  • connection-cap takes {"cap": n}: a ceiling below maxConnections for n ≥ 1, and 0 clears it. A body that is not that gets 400.
  • The state applies at once, is kept on the local volume (it survives a restart) and is uploaded to the channel's control object c/<cluster>/<channel>/control in the background. Every instance polls the control objects every 15 s; the latest updatedMs wins, and on equal updatedMs the greater updatedBy wins. A change is stamped after the state it replaces, so it wins even when that state came from an instance whose clock runs ahead. An instance that finds an older state (or no object) in S3 uploads its own, so a delayed older write cannot roll the fleet back. A change made while S3 is unreachable applies at once and is uploaded when S3 returns.
  • A 500 means the state could not be kept on the volume and was not applied.

Force-Demote ​

bash
spillway_admin -X POST "$ADMIN/admin/channels/consumer-a/force-demote"
spillway_admin -X DELETE "$ADMIN/admin/channels/consumer-a/force-demote"
spillway_admin -X POST "$ADMIN/admin/force-demote"
spillway_admin -X DELETE "$ADMIN/admin/force-demote"

Each answers 200 {"forceDemote": true} or {"forceDemote": false}.

A force-demote moves the named channels' local backlog on this instance to S3, minute by minute, whatever the storage limits, and holds their promotion off until DELETE ends it or Spillway restarts; it is held in memory only. DLQ entries never demote. Arrivals on a force-demoted channel still spill locally and are then demoted. While the object store is unreachable a force-demote waits for it. Watch backlog.local and backlog.retry fall to 0 in the channel's status.

On a degraded volume a force-demote evacuates it, uploading what it can read without recording rows or deleting anything, and the channel's status reports evacuated once every local file is uploaded. This holds whether the force-demote was on before the volume degraded or was requested after: a request on a degraded volume is accepted without its control row, since rows cannot be synced, and logged at warn with the caller. On a healthy volume a force-demote whose row cannot be recorded is refused with 503 and changes nothing.

DLQ Replay ​

bash
spillway_admin -X POST "$ADMIN/admin/channels/consumer-a/dlq/replay"

Moves every DLQ entry of the channel back to delivery with its attempts reset, in groups of 4096, recording a retry row for each. It answers {"replayed": n, "failed": n}: 200 when nothing failed, 500 when some entries could not be moved (they stay in the DLQ). A replay stops, answering its counts so far, when the client disconnects, and with 503 and an error field when the volume becomes degraded part-way. A replay or purge started while the DLQ is still being counted after a restart keeps it uncounted until the replay or purge finishes: its age-off is off, its bytes are out of usage, and dlqCounted stays false.

DLQ Purge by Received Time ​

A purge by time takes two calls. The first counts what would be purged and answers 409 with a confirmation token:

bash
spillway_admin -X POST "$ADMIN/admin/channels/consumer-a/dlq/purge?before=1763300000000"
json
{ "confirm": "9f2c…", "files": 12, "bytes": 4915200, "beforeMs": 1763300000000, "expiresMs": 1763300060000 }

The second, with the token and the same before, purges:

bash
spillway_admin -X POST "$ADMIN/admin/channels/consumer-a/dlq/purge?before=1763300000000&confirm=9f2c…"
json
{ "purged": 12, "failed": 0 }
  • before is epoch milliseconds; entries received at or before it are purged, judged by the received time in each DLQ file name.
  • The token holds only the cutoff. It is not bound to the caller, so any operator may confirm it. It is valid for one minute and for one use, and a new preview replaces the channel's earlier token. A token that is wrong, expired or for another cutoff gets 403 confirmation token not valid.
  • Entries received by the cutoff that reach the DLQ after the preview are purged too.
  • Each group's purged rows are synced before any of its files is deleted. A group whose rows cannot be recorded is not deleted and stops the purge with 503, carrying the counts so far; 500 means some files could not be deleted.
  • A crash between a group's synced rows and its deletes leaves those files in the DLQ; purging them again writes a second purged row for each. Readers of the audit group on DID and data_sink together, since one DID sent by two data sinks is two files with their own outcomes; see Guarantees for how a group's outcome is read.

DLQ Purge by DID ​

bash
spillway_admin -X POST -H 'Content-Type: application/json' \
  -d '{"dids": ["5b0e9e2a-3c4f-4d1e-9a7b-2f6c8d9e0a1b"]}' \
  "$ADMIN/admin/channels/consumer-a/dlq/purge"
json
{ "results": { "5b0e9e2a-3c4f-4d1e-9a7b-2f6c8d9e0a1b": "purged" } }

Purges every DLQ entry of each named DID, 1 to 1000 DIDs per request, in one step. A DID sent to the channel by more than one data sink has an entry for each, and every one of them in the channel's DLQ is purged, each with its own purged row naming its data_sink. Each DID is answered purged, not found or failed; the status is 500 when any failed. A request with both before and a body, or neither, gets 400.

DID Lookup ​

bash
spillway_admin "$ADMIN/admin/dids/5b0e9e2a-3c4f-4d1e-9a7b-2f6c8d9e0a1b"
spillway_admin "$ADMIN/admin/dids/5b0e9e2a-3c4f-4d1e-9a7b-2f6c8d9e0a1b?channel=consumer-a"

Searches each channel's local, retry and DLQ files, then the footers of its S3 segments, and answers 200 with the first entry found:

json
{
  "did": "5b0e9e2a-3c4f-4d1e-9a7b-2f6c8d9e0a1b",
  "channel": "consumer-a",
  "state": "dlq",
  "attempts": 0,
  "receivedMs": 1763299000000,
  "source": "compose",
  "dataSink": "consumer-a",
  "size": 409600,
  "path": "/spool/dlq/consumer-a/1763299000000-5b0e9e2a-3c4f-4d1e-9a7b-2f6c8d9e0a1b-….ent"
}

The lookup is by DID alone. A DID sent by more than one data sink can have a copy for each; the answer is the first copy found, with its dataSink, and the others are not listed. List the channel's dlq/ or local/ directory, whose file names carry the DID, to see every copy.

state is local, retry, dlq or s3. A retry entry also has notBeforeMs; an S3 entry has segmentKey and memberState, its state when it was demoted, and no path.

  • ?channel=<id> searches one channel only.
  • One lookup runs at a time; another gets 429 a DID lookup is already running.
  • Reading S3 footers can be slow. A lookup stops after 2 minutes with 404 naming how many segments it did not read. Other 404 bodies say did not found, did not found locally; S3 unavailable, or how many segments were unreadable.

Volume Reset ​

bash
spillway_admin -X POST "$ADMIN/admin/volume/reset"

Clears the degraded flag after an operator has checked the volume, and answers {"degraded": false}. It then re-queues the entries left on disk but out of delivery while the volume was degraded, such as files whose delivered row failed, so they are delivered, demoted and aged off without a restart; a channel whose entries cannot be listed again is logged at error with the channel, and its stranded entries wait for a restart. When the audit journal's fsync failed, only a restart clears the flag: the reset answers 409, with the flag left set and a degradedReason naming the failure:

json
{ "degraded": true, "degradedReason": "the audit journal's fsync failed (…); restart spillway to clear the degraded flag" }

A restart also clears the flag, and repeats the startup checks.

Not in This Release ​

GET /admin/instances and POST /admin/instances/<id>/adopt, the fleet census and forced adoption, are part of V1.

Contact US