Sentry API Skill
Overview
Sentry tracks exceptions, traces, and crashes. This skill covers the @sentry/node integration for backend error capturing and the Sentry REST API for release management.
Installation
npm install @sentry/node @sentry/profiling-node
pip install sentry-sdk
Authentication
Client SDKs use a DSN (Data Source Name). The REST API uses a Bearer token generated from the Sentry Auth token settings.
Core Concepts
- DSN: The ingestion endpoint URL.
- Release: A version of your code attached to events for regression tracking.
- Transaction: A logical grouping of spans for performance tracing.
Common Workflows
- Call
Sentry.init({ dsn })early in the application lifecycle. - Wrap controllers or use framework middleware.
- Call
Sentry.captureException(error)for handled exceptions.
Error Handling
The Sentry SDK fails silently on network errors so it does not crash your application.
Security
Use the beforeSend hook to scrub PII (Passwords, SSNs, Auth Tokens) before the payload leaves your server.
Rate Limits
Event ingestion is limited by your organization's quota. Exceeding it results in dropped events (HTTP 429).
Best Practices
Always set the release and environment tags during Sentry.init to enable accurate issue tracking across deployments.
Troubleshooting
If source maps aren't working, ensure the @sentry/cli or Webpack plugin uploaded the artifacts for the exact release string matching your deployed code.
References
Why use this skill
Use this when your agent works with sentry — structured patterns beat pasted docs and prevent common hallucinations.
AI pitfalls
- Using outdated SDK or API versions from training data
- Inventing environment variable names
- Omitting error handling and retry logic
Production checklist
- Secrets in environment variables, not source code
- Error handling and logging in place
- Rate limits and timeouts configured
Related skills
Last Verified: 2026-07-02