Let the worker do the grouping.

Faultwing is a self-hosted error monitor and my Boot.dev capstone. Most of its backend follows from one decision: accept an exception quickly, and do the real work later.

On paper, an error monitor has a simple job: take in exceptions, notice which ones are the same bug, and show them as issues. Most of the interesting decisions in Faultwing sit between “take in” and “show.”

Accepted is not grouped

When an application sends an exception to POST /api/v1/events, the API validates it, writes a row to an event_jobs table, and answers 202 Accepted. That status means one specific thing: the event is safely stored in PostgreSQL. It does not mean the event has been grouped yet.

Keeping the request that small means ingestion never waits on the slower part of the work, and an event that was accepted is already durable before anything else happens to it.

The queue is a table

Faultwing has no separate message broker. PostgreSQL is both the system of record and the job queue. A Go worker claims one job at a time with FOR UPDATE SKIP LOCKED, which lets several workers run side by side without two of them taking the same job.

Once a worker holds a job, it does the rest in one transaction:

  1. fingerprint the exception within its project,
  2. create or update the matching issue,
  3. record the individual event,
  4. publish a PostgreSQL NOTIFY,
  5. and delete the finished job.

If something fails, the job stays in the table. Its attempt count goes up and it is retried with exponential backoff, capped at five minutes. Using the database that was already there kept the moving parts few, and it made the questions a queue has to answer concrete: who owns this job, what happens when it fails, and how do you know it is done?

Notifications only nudge

The dashboard updates live, but the notification carries almost nothing: a project ID and an issue ID. The API forwards it over a WebSocket, and the dashboard reacts by refetching from the API. If a notification goes missing, nothing is lost, because PostgreSQL is still the source of truth.

One detail shaped that code more than I expected: browsers cannot attach an Authorization header to a WebSocket. So the dashboard connects first and sends its session token as the first message, and the server checks it, along with project ownership, before subscribing the connection.

What isn’t done

Faultwing runs well locally, but it is not ready for the public internet. There are no production containers or reverse-proxy and TLS guidance yet, rate limits live inside a single API process, and failed jobs retry forever without a dead-letter queue. Those gaps are the next milestone: a documented deployment path.

The backend is the part I set out to learn. The dashboard, including the terrarium where unresolved issues live as insects, was built with substantial AI assistance, and the README says so.