Build vs buy exception monitoring, tested with a 36‑line DIY ingest
Описание и применение
Автор создал 36‑строчный Node.js‑сервер, принимающий события Sentry SDK, группирующий их по отпечатку и сохраняющий в файл, выявив проблемы с группировкой, всплесками ошибок и потерей событий.
Задача
A side project needed an error tracker but the paid plan was underused and costly.
Результат
The DIY ingest exposed three problems in seconds: excessive grouping, burst error handling, and missed events during downtime.
Рабочий процесс
- 1. Set up a Node.js HTTP server that validates the DSN key.
- 2. Receive and unzip Sentry envelopes.
- 3. Extract exception items and compute a fingerprint from error type and innermost three in‑app stack frames.
- 4. Store grouped issues in a Map and expose a /issues endpoint for inspection.
- 5. Test by sending SDK events and observing grouping, burst handling, and delivery failures.
Доказательства
An ingest that accepts real Sentry SDK events, groups them and writes them to disk fits in 36 lines of Node.
My DIY version showed three problems in a few seconds of testing: grouping by message turned 3 bugs into 32 issues, a 502‑error burst delivered 63 events, and 7 errors thrown while it was down never arrived.
If you buy instead, the choice is SaaS (Sentry Team from $26/mo with 50K errors), heavy self‑hosted (self‑hosted Sentry asks for 4 cores and 16 GB RAM plus 16 GB swap) or light self‑hosted (GlitchTip runs on Postgres plus one service).
- Дата записи: 2026-10-20T06:41:28.730Z