• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / storage / 46675311574 / 2
89%
master: 89%

Build:
DEFAULT BRANCH: master
Ran 01 Dec 2026 03:17PM UTC
Files 399
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Dec 2026 03:07PM UTC coverage: 72.627% (+0.06%) from 72.567%
46675311574.2

push

github

web-flow
feat(queue): metric and log for synchronous job invocations (#1759)

## What

Adds a metric and a log line for every time a queue handler runs
**synchronously**, in-process on the caller, instead of from the queue.
Today these runs are hard to see: the fallback logs a warning before it
runs, but nothing tracks how often it happens, for which queue, or
whether the inline run worked.

### Metric

`queue_job_sync_invocations_total` (counter), one increment per inline
dispatch call (a call can carry several messages; the message count is
in the log line):

| label | values |
|---|---|
| `name` | queue name (e.g. `webhooks`, `object-admin-delete`) |
| `reason` | `invoke`: explicit `queue.invoke` (e.g.
`BucketDeleted.invoke`, `BucketCreatedEvent`)<br>`queue_disabled`:
env-disabled sync queue (`PG_QUEUE_ENABLE=false`)<br>`send_failed`:
`syncFallback` ran the handler after a failed enqueue |
| `status` | `ok` / `error`: whether the inline call succeeded |

Example: `sum by (name)
(rate(queue_job_sync_invocations_total{reason="send_failed"}[5m]))`
shows enqueue failures that degraded to inline runs, per queue.

### Log

One `[Queue] Invoked synchronously` line per call: `debug` on success
(the counter already covers it), `warning` with the `error` on failure.
It carries `type: "queue"`, `project` (only when every message in the
call belongs to the same tenant), `sbReqId`, and `metadata` with
`queue`, `reason`, `status`, `count`, `eventTypes` and `durationMs`.

## How

- `observeSyncInvocation()` in `src/internal/queue/middleware.ts` wraps
an inline dispatch and records the metric and the log.
- `syncFallback` wraps its `invokeMany` (`send_failed`). `syncModeGuard`
wraps the forwarded produce (`queue_disabled`).
- `instance.ts` wraps the public `invoke` and `invokeMany` of each queue
shape it builds (full manager, producer-only, sync queue) for reason
`invoke`. The fallback and the sync queue captured the manager's own
references when they were built, so nothin... (continued)

8389 of 12260 branches covered (68.43%)

Branch coverage included in aggregate %.

14461 of 19202 relevant lines covered (75.31%)

343.49 hits per line

Source Files on job unit - 46675311574.2
  • Tree
  • List 399
  • Changed 4
  • Source Changed 3
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 46675311574
  • c2dce3f0 on github
  • Prev Job for on master (#46672764172.2)
  • Next Job for on master (#46680176435.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc