Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/sentry-migration-deep-dive

@0d57af8
Run it yourself

Migrate to Sentry from other error tracking tools like Rollbar, Bugsnag, or New Relic. Use when replacing an existing error tracker with Sentry, running tools in parallel during a transition, or mapping API calls between providers. Trigger with phrases like "migrate to sentry", "switch from rollbar to sentry", "replace bugsnag with sentry", "sentry migration plan".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/sentry-migration-deep-dive

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesmigration-from-bugsnag.md

≈826 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Migration From Bugsnag

Concept Mapping: Bugsnag to Sentry

Bugsnag "errors" correspond to Sentry "issues." Bugsnag "events" correspond to Sentry "events." Bugsnag's releaseStage maps to Sentry's environment. Bugsnag's appVersion maps to Sentry's release.

SDK Replacement (Node.js)

// BEFORE: Bugsnag initialization
import Bugsnag from '@bugsnag/node';
Bugsnag.start({
  apiKey: process.env.BUGSNAG_KEY,
  releaseStage: process.env.NODE_ENV,
  appVersion: process.env.npm_package_version,
  enabledReleaseStages: ['production', 'staging'],
});

// AFTER: Sentry initialization
import * as Sentry from '@sentry/node';
Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.NODE_ENV,
  release: process.env.npm_package_version,
  tracesSampleRate: 0.1,
});

API Call Translation Table

Bugsnag Sentry Notes
Bugsnag.notify(err) Sentry.captureException(err) Direct replacement
Bugsnag.notify(err, onError) Sentry.withScope(scope => { ... }) Use scope for metadata
Bugsnag.leaveBreadcrumb(msg) Sentry.addBreadcrumb({ message: msg }) Add category and level
Bugsnag.setUser(id, email, name) Sentry.setUser({ id, email, username: name }) Note: name becomes username
bugsnag.addMetadata(tab, data) Sentry.setContext(tab, data) Tab name becomes context key
onError callback beforeSend hook in Sentry.init() Return null to drop event
enabledReleaseStages Custom beforeSend filter Filter by event.environment
@bugsnag/plugin-express Sentry.setupExpressErrorHandler(app) Built into @sentry/node v8+

React Integration Migration

// BEFORE: Bugsnag React error boundary
import Bugsnag from '@bugsnag/js';
import BugsnagPluginReact from '@bugsnag/plugin-react';
Bugsnag.start({
  apiKey: process.env.BUGSNAG_KEY,
  plugins: [new BugsnagPluginReact()],
});
const ErrorBoundary = Bugsnag.getPlugin('react')!.createErrorBoundary(React);

<ErrorBoundary>
  <App />
</ErrorBoundary>

// AFTER: Sentry React error boundary
import * as Sentry from '@sentry/react';
Sentry.init({ dsn: process.env.SENTRY_DSN });

<Sentry.ErrorBoundary fallback={<p>Something went wrong</p>}>
  <App />
</Sentry.ErrorBoundary>

Metadata Migration Pattern

// BEFORE: Bugsnag metadata with onError callback
Bugsnag.notify(error, (event) => {
  event.addMetadata('order', { id: orderId, total: orderTotal });
  event.addMetadata('user', { plan: userPlan });
  event.setUser(userId, userEmail, userName);
  event.severity = 'warning';
});

// AFTER: Sentry scoped context
Sentry.withScope((scope) => {
  scope.setContext('order', { id: orderId, total: orderTotal });
  scope.setContext('user', { plan: userPlan });
  scope.setUser({ id: userId, email: userEmail, username: userName });
  scope.setLevel('warning');
  Sentry.captureException(error);
});

Package Removal

# Remove all Bugsnag packages
npm uninstall @bugsnag/js @bugsnag/node @bugsnag/plugin-react \
  @bugsnag/plugin-express @bugsnag/plugin-vue @bugsnag/plugin-angular

Tons of Skills by Intent Solutions | jeremylongshore.com

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk LOW
  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Gen Agent Trust Hub8mo

    This skill facilitates the migration from various error tracking tools to Sentry. It includes configuration examples and instructions for SDK replacement using standard package managers and environment variables for configuration, posing no security risks.

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
What it can do
Reads files Edits files Runs commands
version
1.51.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
compatibility
Designed for Claude Code
All 8 allowed tools
ReadWriteEditBash(npm:*)Bash(npx:*)Bash(node:*)GrepGlob
Other metadata
tags
[
  "saas",
  "sentry",
  "migration",
  "rollbar",
  "bugsnag",
  "new-relic",
  "error-tracking"
]

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/sentry-migration-deep-dive