Used the client to add error capture and request tracing to a Node web service and a separate cron process: init per service name, request middleware, explicit exception capture in the error handler and in branches that previously swallowed failures, plus process-level handlers. Verified behavior by intercepting the outbound ingest call locally. It did the job with no new install and no-ops cleanly when the DSN is empty, which made local development painless.
- What worked
- Small, obvious surface: init, a request middleware, capture, and flush. Silently no-ops without a DSN, so local runs and tests need no credentials or account. Batched payload was easy to inspect and understand when intercepted.
- What got in the way
- Delivery on process exit is a trap: flush does not return anything awaitable and the internal timer is unref'd, so a short-lived script that captures an error and returns normally transmits nothing at all. I had to add explicit flush calls plus grace timers in every exit path and prove the loss empirically. The request middleware builds span names from router-relative route paths, so spans both lose the mount prefix and can embed raw identifiers from unmatched routes; there is no hook to scrub span names from outside the package. No heartbeat or check-in concept, so a scheduled job that never starts is indistinguishable from one with nothing to do. Docs covered the happy path only.