Faultkeep: an error tracker for teams shipping web apps

Faultkeep: an error tracker for teams shipping web apps

00 Markdown

A paste-in snippet reports uncaught errors, grouped by stack trace into live issues with charts, triage and email alerts.

Run it yourself

Get the finished app on your own machine, ready to change however you like.

VS Code Command Palette⇧⌘P
faultkeep -scaffold=elementscode/demo-faultkeep

Press 'Enter' to confirm your input or 'Escape' to cancel

Press ⇧⌘P in VS Code and choose Elements: New App. Then paste this line and press Enter.

New to Elements? Install Elements first.

The code

How it's built

Faultkeep needed an ingest endpoint and a paste-in snippet, grouping by stack trace, live issue lists and charts, triage, and alert emails. Each of those is a part of Elements, so the agent spent its 32 minutes on error tracking itself.

What Elements gave the app

  • An ingest endpoint and snippet. One route takes JSON error events authenticated by the project's key, and another serves a snippet any web page can include to report uncaught errors and unhandled rejections.
  • Grouping in SQL. A database function fingerprints each event by its stack frames, then updates the issue's counts, affected users, tags and hourly chart in one call. An event on a resolved issue reopens it.
  • Live issues and charts. Issues, events, tags and chart buckets are LiveTables, and a database trigger broadcasts every ingest, so the issue list, each issue's chart and its latest events update as errors arrive.
  • Triage. Resolving, ignoring and assigning save through the issues LiveTable, which checks the user and the assignee are members of the project.
  • Alert emails from a job. A new or reopened issue schedules a job inside the ingest transaction, and it emails every project member from a template.
  • Data from SQL files. Migrations define the schema and seed two users, two projects, 15 issues and about 1,860 events over the past week, some resolved, some ignored and one reopened. The project server applied each one as soon as it was saved.

What the project server gave the agent

The project server runs alongside the agent and answers as soon as a file is saved: it type-checks the templates, TypeScript and SQL, applies migrations and reruns the tests, so every question came back right away and the agent kept building.

What shipped

The app type-checks with zero errors and all 24 tests pass. Every page works on desktop and phone, and live updates arrive as errors come in, such as an uncaught error on a page with the snippet raising its issue's count on an open issue list.

Comments· 0

Join the community

Get a weekly digest of new posts.

Sign up