← All notes

NOTES

Collecting only the error context an app needs

Browser Error Log lets an app choose context while bounding its browser queue and self-hosted storage and query scope.

#error collection#TypeScript#SQLite

An error message needs context

Browser Error Log combines a browser SDK, a self-hosted collector and a viewer. An error message rarely tells you which page it came from or what happened just before it. Keeping every request detail would also mean storing and protecting more data. The app can choose the context it needs while the operator controls collection and storage.

The SDK captures global errors, unhandled promise rejections and network failures. Navigation and network breadcrumbs are opt-in. It leaves request bodies, headers and cookies out of automatic context, and an app can filter further through URL sanitization and the beforeBreadcrumb and beforeSend hooks. The optional React Error Boundary adapter and shared event contract are published as separate @ihyeon packages. The SDK documentation also says that custom transport needs an endpoint before network collection can be enabled.

Limits along the collection path

The browser queue has a size limit and a retry limit. The Node.js micro-server collector writes to SQLite or rotating JSONL and limits retention and query scope. The viewer lets you narrow records by project, error type and date, then inspect stacks and JSON snapshots. Its chart counts received logs, which says nothing on its own about user count or the application's error rate.

SQLite is the default store, but records still need a way into other analysis tools. The v0.2.11 CLI export states the storage choice and size limit explicitly and reads without modifying the source database. The public change record describes checking the original hash and restarting the collector after export.

Passing original locations and event references onward

Since v0.2.21, release-specific source maps can resolve an error in a compressed stack to its original location. The same app.js may resolve to a different source file for each release. In the public viewer, synthetic errors from a local SQLite collector resolved to their respective sources in three browsers. Removing one release's map left the other release's location intact.

In v0.2.22, captureExceptionWithReference returns the project and event ID for a captured error. The React Error Boundary passes the same reference through onCapture, and the Protocol package can extract just those two lookup fields. A synthetic error run against freshly installed public npm packages confirmed that the React callback and transmitted event shared the reference. The ID helps locate an event; it is not confirmation that the server stored it.

Before using it in a service

The public repository records local checks for the packages, micro-server and Chromium/WebKit delivery. The SQLite export check appears in the later v0.2.11 change record. Retries are bounded.

Even with a self-hosted collector, error messages and app-supplied values can contain personal information. URL filtering and hooks cannot prove that every such value has been removed. The operator still has to decide what to collect and retain, and check authentication and access permissions in the actual deployment.

Public sources

Public releases – Published Updated
CONVERSATION

Comments

Open on GitHub ↗

Questions and ideas are welcome. Sign in with GitHub to comment; replies are public and shared between the Korean and English versions.