What to measure for Sume API jobs: metrics, labels and alerts
A metrics plan for code that calls the Sume API: submit outcome, queue wait, time to terminal, error code and webhook gap, with low-cardinality labels.

Five measurements cover most of what goes wrong in a Sume integration: submit outcome, time spent queued, time to terminal, terminal error code, and the gap between a job finishing and your webhook handler seeing it. All of them come from fields the API already returns.
The measurements
Use the job status vocabulary as labels, because it is a closed set: queued, processing, completed, failed, canceled. Use error.code for submit failures. Keep job ids and request ids out of metric labels and in logs, where high cardinality is fine.
| Metric | Source field | Why it matters |
|---|---|---|
| Submit result count | HTTP status and error.code | Separates 402, 429 and 503 causes |
| Queue wait | job.queued to job.started events | Shows plan concurrency pressure |
| Time to terminal | job.created to job.completed or job.failed | Sets your client deadline |
| Terminal outcome count | completed, failed, canceled | Failure rate by model |
| Webhook gap | terminal time minus handler receipt | Spots missed deliveries |
Alerts that are worth waking up for
Alert on a rising share of 402 insufficient_credits, since retrying never helps and it means spend or top-up drifted. Alert on any sustained queue_full, which means you submit faster than the plan processes. Alert on webhook gaps, then fall back to polling status_url; the docs describe delivery as an optimization, never the only recovery path.
Where the timestamps live
GET /v1/jobs/:id/events returns a public timeline with job.created, job.queued, job.started, generation.submitted, and the terminal events, plus webhook.delivery. Read it for one slow job rather than polling it for every job.
Sources
Related posts
More in Developers
- WhatsApp video: H.264 High profile with B-frames fails on Android
WhatsApp Cloud API says H.264 High profile with B-frames is unsupported on Android and recommends Main or Baseline. What Sume trim does and does not promise.
- Where a Recast result lives: the media.sume.com URL and how to keep it
A finished h3-max-recast job returns a media.sume.com video artifact. Read it at /v1/jobs/{id}/result, store the Sume URL and download your own copy.
- Which episode finished? Map a Sume run id to your episode record
A Sume Format run does not echo your episode number. Keep a ledger keyed by queue index and run id, and match webhooks on request_id.
- Which limit stopped my agent: 402, queue_full or spend cap
Six different walls look alike from an agent loop. A diagnosis table that tells wallet, run spend cap, queue, request rate, scope and provider credits apart.
Written by Sume