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".
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
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".
Designed for Claude Code, also compatible with Codex and OpenClaw
Sentry Known Pitfalls
Overview
Ten production-grade Sentry SDK anti-patterns that silently break error tracking, inflate costs, or leave teams blind to failures. Each pitfall includes the broken pattern, root cause, and production-ready fix.
Sentry collects errors but does not notify anyone by default. Without alerts, critical bugs go unnoticed for hours.
Three-tier alert structure:
Tier
Trigger
Channel
Immediate
New fatal/error issue in prod
PagerDuty
Urgent
Error rate > 100 events in 5 min
Slack #alerts
Awareness
Issue unresolved > 7 days
Email digest
Set up in Sentry UI: Alerts > Create Alert > Issue Alert (Tier 1) or Metric Alert (Tier 2). See monitoring pitfalls for API-based alert creation.
Step 12: Run the Full Audit Checklist
See audit script for a bash script that checks all 10 pitfalls in one pass.
Output
Audit report listing which of the 10 pitfalls were found
Code changes applied for each identified pitfall
Confirmation that beforeSend returns event on all paths
environment and release properly configured
Alert rules created or recommended (three tiers)
Error Handling
Pitfall
Symptom
Fix
Hardcoded DSN
Spam events from attackers
process.env.SENTRY_DSN or build-time injection
sampleRate: 1.0
10-50x cost overrun
tracesSampler with per-endpoint rates
No flush()
Zero events from Lambda/CLI
await Sentry.flush(2000) before exit
beforeSend drops all
Events silently vanish
Always end with return event
Release mismatch
Minified stack traces
Single SENTRY_RELEASE env var
Swallowed catch
Cascading undefined errors
Re-throw after capture
No environment
Dev noise in prod dashboard
environment: process.env.NODE_ENV
Wrong SDK import
Build failure or bloat
Platform-specific SDK package
Ignoring 429s
Data loss at peak traffic
Spike protection + circuit breaker
No alerts
Bugs accumulate unnoticed
Three-tier alert rules
Examples
Example 1: Full-stack audit of existing Sentry setup
Request: "Audit our Sentry integration for common mistakes"
Result: Found hardcoded DSN in config.ts (Pitfall 1), 100% tracesSampleRate (Pitfall 2), no environment tag (Pitfall 7), and zero alert rules (Pitfall 10). Applied fixes for all four, added CI gate for DSN detection, created three-tier alert config. See examples for more scenarios.
Example 2: Debugging missing Lambda errors
Request: "Sentry shows no errors from our Lambda functions but we know they're failing"
Result: Identified Pitfall 3 — no flush() call before Lambda return. Wrapped all handlers with Sentry.wrapHandler() from @sentry/aws-serverless. Events now appear within 5 seconds of invocation.
Example 3: Source map stack traces showing minified code
Request: "Sentry stack traces are all minified even though we upload source maps"
Result: SDK used release: "2.1.0" while CLI used "v2.1.0" (Pitfall 5). Unified both to $GIT_SHA via shared SENTRY_RELEASE env var. Stack traces now show original TypeScript source.