sentry-sdk-patterns

Featured

Best practices for using Sentry SDK in TypeScript and Python. Use when implementing structured error context with scopes, breadcrumb strategies, beforeSend/beforeBreadcrumb filtering, custom fingerprinting, user context, or performance span creation. Trigger: "sentry best practices", "sentry patterns", "sentry sdk usage", "sentry scope", "sentry breadcrumbs", "sentry beforeSend", "sentry fingerprint".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Sentry SDK Patterns ## Overview Production patterns for `@sentry/node` (v8+) and `sentry-sdk` (Python 2.x+) covering scoped error context, breadcrumb strategies, event filtering with `beforeSend`, custom fingerprinting for issue grouping, and performance instrumentation with spans. All examples use real Sentry SDK APIs. ## Prerequisites - Sentry SDK v8+ installed (`@sentry/node`, `@sentry/react`, or `sentry-sdk`) - `SENTRY_DSN` environment variable configured - Familiarity with async/await (TypeScript) or context managers (Python) ## Instructions ### Step 1 -- Structured Error Context with Scopes Use `Sentry.withScope()` (TypeScript) or `sentry_sdk.new_scope()` (Python) to attach context to individual events without leaking state across requests. **TypeScript -- Scoped error capture:** ```typescript import * as Sentry from '@sentry/node'; type ErrorSeverity = 'low' | 'medium' | 'high' | 'critical'; interface ErrorOptions { severity?: ErrorSeverity; tags?: Record<string, string>; context?: Record<string, unknown>; user?: { id: string; email?: string }; fingerprint?: string[]; } const SEVERITY_MAP: Record<ErrorSeverity, Sentry.SeverityLevel> = { low: 'info', medium: 'warning', high: 'error', critical: 'fatal', }; export function captureError(error: Error, options: ErrorOptions = {}) { Sentry.withScope((scope) => { scope.setLevel(SEVERITY_MAP[options.severity || 'medium']); if (options.tags) { Object.entries(options.tags).forEach...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

sentry-error-capture

Implement advanced error capture and context enrichment with Sentry. Use when adding captureException/captureMessage calls, enriching errors with user context, tags, breadcrumbs, or custom fingerprinting. Trigger with "sentry error capture", "sentry context", "enrich sentry errors", "sentry exception handling", "sentry breadcrumbs", "sentry fingerprint".

2,266 Updated today
jeremylongshore
AI & Automation Featured

sentry-reliability-patterns

Build reliable Sentry integrations with graceful degradation, circuit breakers, and offline queuing. Use when implementing fault-tolerant error tracking, handling SDK initialization failures, building retry logic for Sentry transports, or ensuring apps survive Sentry outages. Trigger with "sentry reliability", "sentry circuit breaker", "sentry offline queue", "sentry graceful degradation", "sentry failover", or "resilient sentry setup".

2,266 Updated today
jeremylongshore
DevOps & Infrastructure Featured

sentry-architecture-variants

Configure Sentry error tracking and performance monitoring for different application architectures. Use when setting up Sentry for monoliths, microservices, serverless functions, event-driven systems, frontend SPAs, mobile apps, or hybrid deployments. Trigger: "sentry monolith setup", "sentry microservices tracing", "sentry serverless lambda", "sentry event-driven kafka", "sentry react native", "sentry architecture pattern".

2,266 Updated today
jeremylongshore
AI & Automation Featured

sentry-known-pitfalls

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".

2,266 Updated today
jeremylongshore
AI & Automation Featured

sentry-performance-tracing

Set up performance monitoring and distributed tracing with Sentry. Use when implementing performance tracking, tracing requests, or monitoring application performance. Trigger with phrases like "sentry performance", "sentry tracing", "sentry APM", "monitor performance sentry".

2,266 Updated today
jeremylongshore