Back to projects
Projectadvanced 7 steps ~90 min

Frontend Observability SDK

Build breadcrumbs, PII scrubbing, fingerprinting, batching, and sampling into a telemetry SDK, plus an issues dashboard.

What you'll build

A working telemetry SDK plus a dashboard that groups errors into issues and shows metrics by release.

  • JavaScript
  • error handling
  • batching
  • sampling
  • React
Project briefrequirements and design decisions

Requirements

  • Capture errors with message, stack, release, route, and breadcrumbs
  • Group identical errors into issues with stable fingerprints
  • Batch events and send at most one request per batch
  • Sample sessions, but always keep errors
  • Scrub emails and tokens before anything leaves the browser

Architecture decisions

  • Small core with plugins (errors, breadcrumbs, vitals) instead of one big module
  • Ring buffer for breadcrumbs keeps memory bounded
  • Transport is injected, so tests run without a network
  • Session-level sampling decided once at init

Stretch goals

  • Capture Web Vitals with attribution
  • Propagate traceparent headers to your own API
  • Rate-limit identical errors per session

Production checklist

  • sendBeacon / keepalive on page hide
  • Source-map upload in CI
  • Consent handling and a data-retention policy
  • SDK size budget (a few KB gzipped)

1What we're building

Error-tracking and RUM products (Sentry, Datadog, New Relic) all ship a browser SDK with the same core design. You'll build a small one to understand the decisions inside it:

  1. A plugin-based core: init({ release, transport, sampleRate }) plus plugins for breadcrumbs and errors.
  2. Breadcrumbs in a bounded ring buffer: the last N things that happened before an error.
  3. PII scrubbing before anything leaves the browser.
  4. Fingerprinting: 1,000 error events become a handful of issues.
  5. Batching and session sampling, with an injected transport so it's testable without a network.
  6. A dashboard that renders issues from the captured events.

Most steps are plain JavaScript that runs in the console. SDKs must not depend on any UI framework.

Design constraint: an SDK runs on every page load of someone else's app. It must be small, fast, and never throw. A bug in telemetry code must never break the product.

Frontend Observability SDK project | Bloom