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.

referenceserror-capture-pitfalls.md

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

Error Capture Pitfalls

Pitfall 4: beforeSend Accidentally Returning null

beforeSend must return event to send or null to drop. Missing return statements cause JavaScript to return undefined, which Sentry treats as "drop."

// WRONG — non-error events silently vanish
Sentry.init({
  beforeSend(event) {
    if (event.level === 'error') {
      return event;
    }
    // No return — warnings, info, fatal all dropped
  },
});

// RIGHT — always return event as final statement
Sentry.init({
  beforeSend(event, hint) {
    const error = hint?.originalException;
    if (error instanceof Error && error.message.match(/^NetworkError/)) {
      return null;  // Explicit drop
    }
    return event;  // Always the last line
  },
});

Pitfall 6: Capturing Errors Without Re-Throwing

Catching errors, sending to Sentry, but not re-throwing causes cascading undefined failures downstream.

// WRONG — error swallowed, returns undefined
async function getUser(id: string) {
  try {
    return await fetch(`/api/users/${id}`).then(r => r.json());
  } catch (error) {
    Sentry.captureException(error);
    // Returns undefined — callers break silently
  }
}

// RIGHT — capture and re-throw
async function getUser(id: string) {
  try {
    return await fetch(`/api/users/${id}`).then(r => r.json());
  } catch (error) {
    Sentry.captureException(error);
    throw error;  // Let caller handle it
  }
}

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