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

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

Build:
DEFAULT BRANCH: master
Ran 01 Dec 2026 03:17PM UTC
Files 380
Run time 7s
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: 68.808% (-0.03%) from 68.841%
46675311574.1

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)

7008 of 11411 branches covered (61.41%)

Branch coverage included in aggregate %.

13399 of 18247 relevant lines covered (73.43%)

1012.11 hits per line

Source Files on job rest-pg18 - 46675311574.1
  • Tree
  • List 380
  • 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.1)
  • 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