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

/sentry-known-pitfalls

@0d57af8
Run it yourself

Identify and fix common Sentry SDK pitfalls that cause silent data loss, cost overruns, and missed alerts. Covers 10 anti-patterns with fix code. Use when auditing Sentry config, debugging missing events, or reviewing SDK setup. Trigger: "sentry pitfalls", "sentry anti-patterns", "sentry mistakes", "why are sentry events missing".

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesconfiguration-pitfalls.md

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

Configuration Pitfalls

Pitfall 1: Hardcoded DSN in Source Code

The DSN identifies your Sentry project. Hardcoding it in source means it ships in client bundles, gets committed to version control, and cannot be rotated without a deploy.

// WRONG — DSN hardcoded
Sentry.init({
  dsn: 'https://abc123@o123456.ingest.us.sentry.io/7890123',
});

// RIGHT — environment variable
Sentry.init({
  dsn: process.env.SENTRY_DSN,
});

// RIGHT — build-time injection for browser apps (Vite)
// vite.config.ts
export default defineConfig({
  define: { __SENTRY_DSN__: JSON.stringify(process.env.SENTRY_DSN) },
});
// app.ts
Sentry.init({ dsn: __SENTRY_DSN__ });

CI gate:

if grep -rq "ingest\.sentry\.io" --include="*.ts" --include="*.js" src/; then
  echo "ERROR: Hardcoded DSN detected" && exit 1
fi

Pitfall 2: Setting sampleRate: 1.0 in Production

100% sampling sends every trace to Sentry. At 500K requests/day, that is ~$371/month in overage charges.

// WRONG — 100% of everything
Sentry.init({
  tracesSampleRate: 1.0,
});

// RIGHT — smart sampling
Sentry.init({
  tracesSampler: ({ name, parentSampled }) => {
    if (typeof parentSampled === 'boolean') return parentSampled;
    if (name?.match(/\/(health|ping|ready)/)) return 0;
    if (name?.includes('/checkout')) return 0.25;
    return 0.01;
  },
});

Pitfall 7: Not Using the environment Tag

Without environment, dev errors pollute production dashboards and alert rules fire on local noise.

// WRONG — no environment
Sentry.init({ dsn: process.env.SENTRY_DSN });

// RIGHT — explicit environment
Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.NODE_ENV || 'development',
});

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

    This skill is a diagnostic tool for auditing Sentry SDK implementations for common configuration errors and performance anti-patterns. It uses standard search tools to identify issues and provides recommended code corrections. No malicious behaviors were detected.

  • 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 10 allowed tools
ReadWriteEditGrepGlobBash(node:*)Bash(npm:*)Bash(npx:*)Bash(grep:*)Bash(find:*)
Other metadata
tags
[
  "saas",
  "sentry",
  "anti-patterns",
  "troubleshooting",
  "best-practices",
  "sdk",
  "configuration"
]

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/sentry-known-pitfalls