sentry-python-setup
Setup Sentry in Python apps. Use when asked to add Sentry to Python, install sentry-sdk, or configure error monitoring for Python applications, Django, Flask, FastAPI.
Best use case
sentry-python-setup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Setup Sentry in Python apps. Use when asked to add Sentry to Python, install sentry-sdk, or configure error monitoring for Python applications, Django, Flask, FastAPI.
Teams using sentry-python-setup should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/sentry-python-setup/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How sentry-python-setup Compares
| Feature / Agent | sentry-python-setup | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Setup Sentry in Python apps. Use when asked to add Sentry to Python, install sentry-sdk, or configure error monitoring for Python applications, Django, Flask, FastAPI.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Sentry Python Setup
Install and configure Sentry in Python projects.
## Invoke This Skill When
- User asks to "add Sentry to Python" or "install Sentry" in a Python app
- User wants error monitoring, logging, or tracing in Python
- User mentions "sentry-sdk" or Python frameworks (Django, Flask, FastAPI)
## Install
```bash
pip install sentry-sdk
```
## Configure
Initialize as early as possible in your application:
```python
import sentry_sdk
sentry_sdk.init(
dsn="YOUR_SENTRY_DSN",
send_default_pii=True,
# Tracing
traces_sample_rate=1.0,
# Profiling
profile_session_sample_rate=1.0,
profile_lifecycle="trace",
# Logs
enable_logs=True,
)
```
### Async Applications
For async apps, initialize inside an async function:
```python
import asyncio
import sentry_sdk
async def main():
sentry_sdk.init(
dsn="YOUR_SENTRY_DSN",
send_default_pii=True,
traces_sample_rate=1.0,
enable_logs=True,
)
# ... rest of app
asyncio.run(main())
```
## Framework Integrations
### Django
```python
# settings.py
import sentry_sdk
sentry_sdk.init(
dsn="YOUR_SENTRY_DSN",
send_default_pii=True,
traces_sample_rate=1.0,
enable_logs=True,
)
```
### Flask
```python
from flask import Flask
import sentry_sdk
sentry_sdk.init(
dsn="YOUR_SENTRY_DSN",
send_default_pii=True,
traces_sample_rate=1.0,
enable_logs=True,
)
app = Flask(__name__)
```
### FastAPI
```python
from fastapi import FastAPI
import sentry_sdk
sentry_sdk.init(
dsn="YOUR_SENTRY_DSN",
send_default_pii=True,
traces_sample_rate=1.0,
enable_logs=True,
)
app = FastAPI()
```
## Configuration Options
| Option | Description | Default |
|--------|-------------|---------|
| `dsn` | Sentry DSN | Required |
| `send_default_pii` | Include user data | `False` |
| `traces_sample_rate` | % of transactions traced | `0` |
| `profile_session_sample_rate` | % of sessions profiled | `0` |
| `enable_logs` | Send logs to Sentry | `False` |
| `environment` | Environment name | Auto-detected |
| `release` | Release version | Auto-detected |
## Environment Variables
```bash
SENTRY_DSN=https://xxx@o123.ingest.sentry.io/456
SENTRY_AUTH_TOKEN=sntrys_xxx
SENTRY_ORG=my-org
SENTRY_PROJECT=my-project
```
Or use in code:
```python
import os
import sentry_sdk
sentry_sdk.init(
dsn=os.environ.get("SENTRY_DSN"),
# ...
)
```
## Verification
```python
# Intentional error to test
division_by_zero = 1 / 0
```
Or capture manually:
```python
sentry_sdk.capture_message("Test message from Python")
```
## Troubleshooting
| Issue | Solution |
|-------|----------|
| Errors not appearing | Ensure `init()` is called early, check DSN |
| No traces | Set `traces_sample_rate` > 0 |
| IPython errors not captured | Run from file, not interactive shell |
| Async errors missing | Initialize inside async function |Related Skills
setup-tanstack-start
Bootstrap a new web project with TanStack Start, React, Tailwind CSS v4, and shadcn/ui on top of the base tooling stack. Consult this skill whenever creating a web app, setting up a frontend project, starting a React application, or initializing anything involving TanStack Start, TanStack Router, TanStack Query, Tailwind, shadcn, or Vite.
setup-project
Setup Claude Code Configuration with full RALPH autonomous development integration
setup-node
Sets up Node.js/TypeScript development environment with npm/yarn, dependencies, ESLint, Prettier, testing (Jest/Vitest), and TypeScript type checking. Ensures consistent tooling configuration. Use when starting work on Node.js/TypeScript projects, after cloning repositories, setting up CI/CD, or troubleshooting environment issues.
setup-earl
Installs Earl, configures MCP integration for your agent platform, writes CLAUDE.md instructions, and routes to template creation or migration. Use when setting up Earl for the first time, when a new developer is onboarding to a project that uses Earl, or when Earl needs to be connected to an agent platform.
setup-claude-code
Claude Code 프로젝트 설정 생성
setup-cdk-templates
Use when creating CLAUDE.md files or .claude/ directories - detects project type, generates appropriate templates, and scaffolds Claude configuration with commands and hooks
setup-api-key
Guide users through obtaining and configuring a Vapi API key. Use when the user needs to set up Vapi, when API calls fail due to missing keys, or when the user mentions needing access to Vapi's voice AI platform.
sentry-setup-tracing
Setup Sentry Tracing (Performance Monitoring) in any project. Use this when asked to add performance monitoring, enable tracing, track transactions/spans, or instrument application performance. Supports JavaScript, TypeScript, Python, Ruby, React, Next.js, and Node.js.
sentry-setup-metrics
Setup Sentry Metrics in any project. Use this when asked to add Sentry metrics, track custom metrics, setup counters/gauges/distributions, or instrument application performance metrics. Supports JavaScript, TypeScript, Python, React, Next.js, and Node.js.
sentry-setup-logging
Setup Sentry Logging in any project. Use this when asked to add Sentry logs, enable structured logging, setup console log capture, or integrate logging with Sentry. Supports JavaScript, TypeScript, Python, Ruby, React, Next.js, and other frameworks.
sentry-python-sdk
Full Sentry SDK setup for Python. Use when asked to "add Sentry to Python", "install sentry-sdk", "setup Sentry in Python", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for Python applications. Supports Django, Flask, FastAPI, Celery, Starlette, AIOHTTP, Tornado, and more.
sentry-debugger
Debug production issues using Sentry error tracking API. Use when Claude needs to investigate production errors, crashes, or issues by fetching error data from Sentry - including stack traces, user context, breadcrumbs, and error frequency. Triggers on requests like "check Sentry for errors", "debug this production issue", "what's causing crashes", "investigate errors in [project]", or when users share Sentry issue URLs.