Skip to content

feat: add React + Sentry example#1

Open
Catalin4513 wants to merge 7 commits into
mainfrom
add-react-sentry-example
Open

feat: add React + Sentry example#1
Catalin4513 wants to merge 7 commits into
mainfrom
add-react-sentry-example

Conversation

@Catalin4513

Copy link
Copy Markdown

Adds the first example to the repo: a minimal React (Vite + TypeScript) todo app instrumented with @sentry/react, sending data to Uptrace via Uptrace's Sentry-compatible ingest endpoint.

What it shows

  • Breadcrumbs — add / toggle / delete / filter actions each leave a breadcrumb.
  • Errors — a button throws one of several error types (Error, TypeError, RangeError, TodoSyncError), raised a few frames deep so the stack trace has real app frames.
  • Messages — a button sends Sentry.captureMessage() at a random level (info / warning / error).
  • Spans / traces — a button runs run_traced_task with two child spans; browser tracing also emits page-load/navigation spans.

Wiring

The only Uptrace-specific code is a plain Sentry.init({ dsn }) in src/instrument.ts; the DSN comes from VITE_SENTRY_DSN. The README walks through copying the Sentry DSN from a project's Data Source Name page, configuring .env, running with npm run dev, and where each signal appears in the Uptrace UI.

Verified: tsc -b + vite build pass; empty and populated states render correctly in a headless Chrome check.

@Catalin4513 Catalin4513 requested a review from vmihailenco June 29, 2026 14:23
@Catalin4513

Copy link
Copy Markdown
Author

@vmihailenco, PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant