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

/sentry-upgrade-migration

@0d57af8
Run it yourself

Upgrade Sentry SDK versions and migrate breaking API changes. Use when upgrading from Sentry v7 to v8, migrating Python SDK v1 to v2, replacing deprecated Hub/Transaction APIs, or running the migr8 codemod. Trigger: "upgrade sentry", "sentry migration", "sentry breaking changes", "migrate sentry v7 to v8", "update sentry sdk".

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesexamples.md

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

Examples

Example 1: Express App v7 to v8 Migration

Request: "Upgrade our Express API from Sentry v7.114 to v8"

Before (v7):

// app.ts — everything in one file
import * as Sentry from '@sentry/node';
import { Integrations } from '@sentry/tracing';
import express from 'express';

const app = express();

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  integrations: [
    new Integrations.Express({ app }),
    new Sentry.Integrations.Http({ tracing: true }),
  ],
  tracesSampleRate: 0.2,
});

app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());

app.get('/api/users', async (req, res) => {
  const transaction = Sentry.startTransaction({ name: 'get-users', op: 'http' });
  const span = transaction.startChild({ op: 'db.query', description: 'SELECT users' });

  const users = await db.query('SELECT * FROM users');
  span.finish();
  transaction.finish();

  res.json(users);
});

app.use(Sentry.Handlers.errorHandler());
app.listen(3000);

After (v8):

// instrument.mjs — separate file, loaded first
import * as Sentry from '@sentry/node';

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  tracesSampleRate: 0.2,
  // Express, HTTP, and DB integrations are auto-enabled
});
// app.mjs — run with: node --import ./instrument.mjs app.mjs
import express from 'express';
import * as Sentry from '@sentry/node';

const app = express();

app.get('/api/users', async (req, res) => {
  // startSpan replaces startTransaction + startChild
  const users = await Sentry.startSpan(
    { name: 'get-users', op: 'http.handler' },
    async () => {
      return Sentry.startSpan(
        { name: 'SELECT users', op: 'db.query' },
        async () => {
          return db.query('SELECT * FROM users');
        }
      );
    }
  );
  res.json(users);
});

// v8: Only error handler remains, with new API
Sentry.setupExpressErrorHandler(app);
app.listen(3000);

Result: SDK at v8.49.0, @sentry/tracing removed, Express auto-instrumented, ESM init pattern applied, source maps re-uploaded.

Example 2: React App Browser Migration

Request: "Migrate our React app's Sentry from v7 to v8"

Before (v7):

import * as Sentry from '@sentry/react';
import { BrowserTracing } from '@sentry/tracing';

Sentry.init({
  dsn: '...',
  integrations: [
    new BrowserTracing({
      routingInstrumentation: Sentry.reactRouterV6Instrumentation(
        useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes
      ),
    }),
    new Sentry.Replay(),
  ],
  tracesSampleRate: 0.1,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

After (v8):

import * as Sentry from '@sentry/react';

Sentry.init({
  dsn: '...',
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.replayIntegration(),
    Sentry.reactRouterV6BrowserTracingIntegration({
      useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes,
    }),
  ],
  tracesSampleRate: 0.1,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

Result: @sentry/tracing removed, class-based integrations converted to functions, React Router integration uses new dedicated function.

Example 3: Python Flask v1 to v2

Request: "Upgrade sentry-sdk from 1.40 to 2.x"

Before (v1):

import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration

sentry_sdk.init(
    dsn="...",
    integrations=[FlaskIntegration()],
    traces_sample_rate=0.2,
)

# Setting context
with sentry_sdk.configure_scope() as scope:
    scope.set_tag("environment", "production")
    scope.set_user({"id": "user-123"})

# Scoped operations
with sentry_sdk.push_scope() as scope:
    scope.set_extra("request_data", payload)
    sentry_sdk.capture_message("Processing started")

After (v2):

import sentry_sdk

# Flask integration auto-discovers in v2
sentry_sdk.init(
    dsn="...",
    traces_sample_rate=0.2,
)

# Setting context — direct scope access
scope = sentry_sdk.get_current_scope()
scope.set_tag("environment", "production")
scope.set_user({"id": "user-123"})

# Scoped operations — new_scope replaces push_scope
with sentry_sdk.new_scope() as scope:
    scope.set_extra("request_data", payload)
    sentry_sdk.capture_message("Processing started")

Result: SDK at 2.x, configure_scope replaced, push_scope replaced, Flask integration auto-discovered, test error captured.


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 SAFE
  • Gen Agent Trust Hub2mo

    The skill is designed to help developers upgrade Sentry SDKs and migrate deprecated API patterns. It is safe for its intended use, employing standard development tools and official Sentry packages. A low-severity risk of indirect prompt injection exists because the skill reads and analyzes project source code to identify and migrate breaking changes, which is a necessary part of the migration process.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

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 9 allowed tools
ReadWriteEditBash(npm:*)Bash(npx:*)Bash(pip:*)Bash(node:*)GrepGlob
Other metadata
tags
[
  "saas",
  "sentry",
  "migration",
  "upgrade",
  "sdk",
  "breaking-changes"
]

README badge

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