Self-hosted, Sentry-style error collector for personal projects and homelabs. Apps report errors with a plain HTTP POST (no SDK); identical errors are grouped into issues, stored in embedded SQLite (WAL + FTS5), triaged in a web dashboard, and optionally pushed to ntfy / Discord / a generic webhook.
Live instance: https://{your-domain}/
apps (any language) ──POST /v1/events + X-Api-Key──▶ ┌────────────────────────────┐
│ Fastify server (Node 20) │
browser ──cookie session──▶ / (React SPA) │ • per-service key check │
/api/* (admin API) ───▶ │ • fingerprint + grouping │──▶ webhook alerts
│ • SQLite (WAL, FTS5) │
│ • daily retention (03:00) │
└────────────────────────────┘
| Path | Purpose |
|---|---|
src/index.ts |
Startup: config, DB, alerts, retention scheduler, graceful shutdown |
src/app.ts |
Fastify wiring, static SPA hosting + JSON 404s |
src/config.ts |
Environment validation (zod) |
src/db/ |
SQLite schema (issues, events, events_fts, api_keys) |
src/routes/events.ts |
Ingestion endpoint, per-service API key check |
src/routes/auth.ts |
Dashboard login/logout/session (username + password) |
src/routes/management.ts |
Issues, events, services and API key management |
src/services/ |
Fingerprinting, ingestion, alert dispatcher, retention |
frontend/ |
Vite + React + Tailwind dashboard (built to frontend/dist) |
examples/ |
Client snippets: Node.js, Python, C#, Kotlin |
CLIENT_IMPLEMENTATION.md |
Instructions for adding reporting to an app (for humans or AI) |
- Ingestion: every app/service has its own API key, created in the dashboard. A key is bound to one service name: events for any other service get
403. Keys are shown once, stored only as SHA-256 hashes, and can be revoked instantly (Dashboard → API keys). - Dashboard: a single admin account (
ADMIN_USERNAME+ADMIN_PASSWORD), compared in constant time. Sessions are random 256-bit tokens in an HttpOnly, SameSite=Lax cookie (SecurewhenNODE_ENV=production), valid for 30 days and held in memory (a restart signs everyone out). - Run behind an HTTPS reverse proxy; keys and the session cookie are sent over the wire.
- Node.js 20+ and Yarn 1.x (local), or Docker
yarn install
cp .env.example .env # PowerShell: Copy-Item .env.example .env| Variable | Default | Description |
|---|---|---|
ADMIN_USERNAME |
(required) | Dashboard username |
ADMIN_PASSWORD |
(required) | Dashboard password (use a long random value) |
NODE_ENV |
development |
production enables the Secure cookie flag |
PORT |
8080 |
HTTP port |
HOST |
0.0.0.0 |
Bind address |
DB_PATH |
./data/telemetry.sqlite |
SQLite file (directory auto-created) |
RETENTION_DAYS |
7 |
Days to keep raw events |
ALERT_WEBHOOK_URL |
(optional) | ntfy.sh topic, Discord webhook, or generic JSON webhook |
Generate a password: node -e "console.log(require('crypto').randomBytes(24).toString('hex'))"
Upgrading from 0.3:
INGEST_API_KEYis no longer used. AddADMIN_USERNAMEto.env, sign in, and create a key per service; update each app to use its new key.
yarn dev # backend, watch mode
yarn dev:frontend # Vite UI (second terminal; proxies /api to :8080)
yarn build # typecheck + build UI + server
yarn start # production server and dashboard
yarn test # builds UI, runs the test suiteHealth check: curl http://localhost:8080/healthz
cp .env.example .env # set ADMIN_USERNAME / ADMIN_PASSWORD
docker compose up --build -dData persists in the telemetry-data volume; the service restarts unless stopped and has a /healthz health check. Put it behind a reverse proxy with TLS for public use.
- Sign in at the root URL with
ADMIN_USERNAME/ADMIN_PASSWORD. - Create an API key (API keys tab): enter the exact service name your app will send in
service, click Create, and copy the key immediately. Give the appTELEMETRY_URLandTELEMETRY_KEY(see CLIENT_IMPLEMENTATION.md). - Triage in the Issues tab: search (FTS5), filter by status/service or a
key=valuetag or metadata attribute, open details (stack traces, tags, metadata), Resolve / Ignore / Delete. The same attribute filter is available in Live events. Suggestions use stored event values (up to 50 matches); issue suggestions show their statuses across all stored events. If no unresolved issues match an attribute filter, shortcuts show matching ignored or resolved issues while keeping the other filters. Metadata values must be nonempty strings, numbers, or booleans. A repeat of a resolved issue reopens it. Custom time ranges use local times and apply when you select Apply. Either endpoint may be left blank. Switching to a preset clears the custom dates. Issue details show the latest 50 events matching the active search and tag/metadata filters, or the latest 50 events overall when those filters are empty. Status, service, level and time filters apply to the issue list. Copy an individual event as JSON, or select displayed events and export them as a JSON array. In the Issues tab, select issues and export the latest event of each as a JSON array. Both include all event fields with tags and metadata decoded as JSON; exported data may contain sensitive information. Clipboard access requires HTTPS or localhost. - Watch the Live events tab (polls every 5 s). Select events to delete them using the floating action bar.
- Rotate a key: create a second key for the service, deploy it, then revoke the old one.
- Revoke a leaked key: API keys tab → Revoke (effective immediately).
- Alerts:
error/fatalevents post toALERT_WEBHOOK_URL; the same issue alerts at most once per 30 minutes (in-memory; resets on restart). - Retention: daily at 03:00 UTC, events older than
RETENTION_DAYSare deleted, then the WAL is checkpointed and the DB optimized and vacuumed. Issue rows are kept. - Backup: copy
telemetry.sqlite(plus-wal/-shmif present) while stopped, or usesqlite3 ... ".backup".
POST /v1/events with X-Api-Key: <service key> and a JSON body. Responses: 202 {"status":"accepted","issueId":"..."}, 401 unknown/revoked key, 403 key not valid for this service, 400 invalid payload.
| Field | Required | Notes |
|---|---|---|
service |
yes | Must equal the service the key was created for |
message |
yes | Human-readable message |
level |
no | debug info warn error (default) fatal |
environment |
no | Default production |
exception.type / .value / .stacktrace |
no | Lines starting with at are used for grouping |
tags |
no | { "key": "string value" } |
metadata |
no | Any JSON object |
timestamp |
no | ISO-8601 with timezone; defaults to now |
curl -X POST http://localhost:8080/v1/events \
-H "Content-Type: application/json" \
-H "X-Api-Key: tm_..." \
-d '{"service":"booklog-pantry","message":"Connection refused","exception":{"type":"NpgsqlException","stacktrace":"at Npgsql.Connector.Open() (/app/db.cs:42)"}}'Client helpers: Node.js, Python, C#, Kotlin. Full guidance: CLIENT_IMPLEMENTATION.md.
fingerprint = SHA-256(service + exception type + top app stack frame); the frame ignores node_modules/internal frames and normalizes line numbers, UUIDs, hex and digits. Without a stack trace the normalized message is used.
| Method & path | Description |
|---|---|
POST /api/auth/login |
{ "username", "password" } → sets session cookie |
POST /api/auth/logout |
Ends the session |
GET /api/auth/session |
Session check |
GET /api/issues |
status, service, search (FTS5), level (latest event), tag (key=value), from/to (ISO, matched against last seen), page, pageSize (default 15, max 100) → { items, total, page, pageSize }, latest first |
GET /api/issues/:id |
Issue + latest 50 events |
PATCH /api/issues/:id/status |
{ "status": "unresolved|resolved|ignored" } |
DELETE /api/issues/:id |
Delete issue and events |
GET /api/events |
search, level, tag (key=value), from/to (ISO), page, pageSize (default 15, max 100) → { items, total, page, pageSize }, latest first |
POST /api/issues/bulk-delete, POST /api/events/bulk-delete |
{ "ids": [...] } (max 500) |
GET /api/services |
Distinct service names |
GET /api/keys |
List keys (prefix only) |
POST /api/keys |
{ "service" } → returns the full key once |
DELETE /api/keys/:id |
Revoke a key |
SQLite tables: issues, events, events_fts (FTS5), api_keys (hashes only).
sqlite3 data/telemetry.sqlite "SELECT title, culprit, occurrence_count FROM issues ORDER BY last_seen_at DESC"