Skip to content

gitflarePublicPartly agent-ready50

cf-d1-queues-pulse

Event analytics on Cloudflare D1 and Queues: ingestion API, batched consumer, rollups, live dashboard, load generator, dead-letter view.

Build the full D1 + Queues pulse app: dashboard, load generator, dead letters, percentiles, docs8a65841
Markdown13 lines997 B

API

Errors: { "error": { "code", "message" } }. Bodies over 256 KB return 413 payload_too_large.

  • POST /api/events — one event or array (≤100) {type, path?, country?, value?, ts?}. 202 {accepted, rejected}. An item with poison: true is accepted and enqueued but always fails in the consumer (used by the load generator); it ends in the DLQ after 3 retries.
  • GET /api/stats?window=60 — {totals:{m5,h1,h24,window}, series:[{minute,count}], types, paths, countries:[{key,count}], percentiles:{p50,p95,samples}, consumerLag (ms, minute resolution, null if no data), batches}.
  • GET /api/dlq — {items:[{id,body,error,attempts,at}], count} (newest 200).
  • POST /api/dlq/replay — body {id?}; re-enqueues one (404 if missing) or up to 100, deleting them. {replayed}. Replayed poison items fail again.
  • DELETE /api/dlq — purge all. {deleted}.
  • GET /health — {ok:true}.

HTML responses carry CSP, X-Frame-Options, nosniff and Referrer-Policy headers.