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