Back to articles
Sentry Has a Free Error Tracking Platform — Find and Fix Bugs Before Your Users Report Them

Sentry Has a Free Error Tracking Platform — Find and Fix Bugs Before Your Users Report Them

via Dev.to JavaScriptAlex Spinov

Why Sentry? Sentry captures errors with full stack traces, source maps, breadcrumbs, and context — so you fix bugs before users complain. Quick Start npm install @sentry/node import * as Sentry from ' @sentry/node ' Sentry . init ({ dsn : ' https://your-dsn@sentry.io/123 ' , tracesSampleRate : 0.1 }) // Errors are captured automatically try { riskyOperation () } catch ( error ) { Sentry . captureException ( error ) } React import * as Sentry from ' @sentry/react ' Sentry . init ({ dsn : ' https://your-dsn@sentry.io/123 ' }) function App () { return ( < Sentry . ErrorBoundary fallback = { < p > Something went wrong < /p>} > < MyApp /> < /Sentry.ErrorBoundary > ) } Performance Monitoring const transaction = Sentry . startTransaction ({ name : ' process-order ' }) const span = transaction . startChild ({ op : ' db.query ' }) await db . query ( ' SELECT * FROM orders ' ) span . finish () transaction . finish () Breadcrumbs (What Happened Before the Error) Sentry auto-captures: Console logs

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
7 views

Related Articles