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.

referencessdk-initialization-pitfalls.md

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

SDK Initialization Pitfalls

Pitfall 3: Not Calling flush() in Serverless or CLI

Sentry queues events in memory and sends asynchronously. In serverless functions and CLI scripts, the process exits before the queue drains. Events are captured but never sent.

// WRONG — Lambda exits before events send
export const handler = async (event) => {
  try {
    return await processEvent(event);
  } catch (error) {
    Sentry.captureException(error);
    throw error;  // Events still in queue, never sent
  }
};

// RIGHT — flush before returning
export const handler = async (event) => {
  try {
    return await processEvent(event);
  } catch (error) {
    Sentry.captureException(error);
    await Sentry.flush(2000);
    throw error;
  }
};

// BEST — use framework wrapper
import * as Sentry from '@sentry/aws-serverless';
export const handler = Sentry.wrapHandler(async (event) => {
  return await processEvent(event);
});

Pitfall 8: Importing @sentry/node in Browser Bundle

@sentry/node depends on Node.js built-ins (http, fs, path). Importing it in browser code causes build failures, 100KB+ polyfill bloat, or runtime crashes.

// WRONG — Node SDK in React
import * as Sentry from '@sentry/node';

// RIGHT — platform-specific SDK
import * as Sentry from '@sentry/react';    // React
import * as Sentry from '@sentry/vue';      // Vue
import * as Sentry from '@sentry/nextjs';   // Next.js (handles both)
import * as Sentry from '@sentry/node';     // Server-only code

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