[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71PP7G631Y7JBFTVRF0069X":3,"skill-same:01M71PP7G631Y7JBFTVRF0069X":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M71PP7G631Y7JBFTVRF0069X","sentry-python-sdk",null,"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.","vitalikpestov\u002FSkills-Catalog","vitalikpestov","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F13882997?v=4","01M71N4QG0CWRXX4R24JQZXDDQ","Vitalik Pestov","01M71N4QGMSYRW607DDSE0CQMM",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Engineering\u002Fsentry-python\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"sentry python sdk","sentry","python","sdk","python sdk","metrics","logging","sdk setup","add","full","flask","tracing","install","error monitoring","monitoring","configure","when","fastapi","aiohttp","error","2026-11-10 13:02:02",false,"---\nname: sentry-python-sdk\ndescription: 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.\nlicense: Apache-2.0\n---\n\n# Sentry Python SDK\n\nOpinionated wizard that scans your Python project and guides you through complete Sentry setup.\n\n## Invoke This Skill When\n\n- User asks to \"add Sentry to Python\" or \"setup Sentry\" in a Python app\n- User wants error monitoring, tracing, profiling, logging, metrics, or crons in Python\n- User mentions `sentry-sdk`, `sentry_sdk`, or Sentry + any Python framework\n- User wants to monitor Django views, Flask routes, FastAPI endpoints, Celery tasks, or scheduled jobs\n\n> **Note:** SDK versions and APIs below reflect Sentry docs at time of writing (sentry-sdk 2.x).\n> Always verify against [docs.sentry.io\u002Fplatforms\u002Fpython\u002F](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fpython\u002F) before implementing.\n\n---\n\n## Phase 1: Detect\n\nRun these commands to understand the project before making recommendations:\n\n```bash\n# Check existing Sentry\ngrep -i sentry requirements.txt pyproject.toml setup.cfg setup.py 2>\u002Fdev\u002Fnull\n\n# Detect web framework\ngrep -rE \"django|flask|fastapi|starlette|aiohttp|tornado|quart|falcon|sanic|bottle\" \\\n  requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Detect task queues\ngrep -rE \"celery|rq|huey|arq|dramatiq\" requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Detect logging libraries\ngrep -E \"loguru\" requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Detect AI libraries\ngrep -rE \"openai|anthropic|langchain|huggingface|google-genai|pydantic-ai|litellm\" \\\n  requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Detect schedulers \u002F crons\ngrep -rE \"celery|apscheduler|schedule|crontab\" requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Check for companion frontend\nls frontend\u002F web\u002F client\u002F ui\u002F static\u002F templates\u002F 2>\u002Fdev\u002Fnull\n```\n\n**What to note:**\n- Is `sentry-sdk` already in requirements? If yes, check if `sentry_sdk.init()` is present — may just need feature config.\n- Which framework? (Determines where to place `sentry_sdk.init()`.)\n- Which task queue? (Celery needs dual-process init; RQ needs a settings file.)\n- AI libraries? (OpenAI, Anthropic, LangChain are auto-instrumented.)\n- Companion frontend? (Triggers Phase 4 cross-link.)\n\n---\n\n## Phase 2: Recommend\n\nBased on what you found, present a concrete proposal. Don't ask open-ended questions — lead with a recommendation:\n\n**Always recommended (core coverage):**\n- ✅ **Error Monitoring** — captures unhandled exceptions, supports `ExceptionGroup` (Python 3.11+)\n- ✅ **Logging** — Python `logging` stdlib auto-captured; enhanced if Loguru detected\n\n**Recommend when detected:**\n- ✅ **Tracing** — HTTP framework detected (Django\u002FFlask\u002FFastAPI\u002Fetc.)\n- ✅ **AI Monitoring** — OpenAI\u002FAnthropic\u002FLangChain\u002Fetc. detected (auto-instrumented, zero config)\n- ⚡ **Profiling** — production apps where performance matters\n- ⚡ **Crons** — Celery Beat, APScheduler, or cron patterns detected\n- ⚡ **Metrics** — business KPIs, SLO tracking\n\n**Recommendation matrix:**\n\n| Feature | Recommend when... | Reference |\n|---------|------------------|-----------|\n| Error Monitoring | **Always** — non-negotiable baseline | `${SKILL_ROOT}\u002Freferences\u002Ferror-monitoring.md` |\n| Tracing | Django\u002FFlask\u002FFastAPI\u002FAIOHTTP\u002Fetc. detected | `${SKILL_ROOT}\u002Freferences\u002Ftracing.md` |\n| Profiling | Production + performance-sensitive workload | `${SKILL_ROOT}\u002Freferences\u002Fprofiling.md` |\n| Logging | Always (stdlib); enhanced for Loguru | `${SKILL_ROOT}\u002Freferences\u002Flogging.md` |\n| Metrics | Business events or SLO tracking needed | `${SKILL_ROOT}\u002Freferences\u002Fmetrics.md` |\n| Crons | Celery Beat, APScheduler, or cron patterns | `${SKILL_ROOT}\u002Freferences\u002Fcrons.md` |\n| AI Monitoring | OpenAI\u002FAnthropic\u002FLangChain\u002Fetc. detected | `${SKILL_ROOT}\u002Freferences\u002Fai-monitoring.md` |\n\nPropose: *\"I recommend Error Monitoring + Tracing [+ Logging if applicable]. Want Profiling, Crons, or AI Monitoring too?\"*\n\n---\n\n## Phase 3: Guide\n\n### Install\n\n```bash\n# Core SDK (always required)\npip install sentry-sdk\n\n# Optional extras (install only what matches detected framework):\npip install \"sentry-sdk[django]\"\npip install \"sentry-sdk[flask]\"\npip install \"sentry-sdk[fastapi]\"\npip install \"sentry-sdk[celery]\"\npip install \"sentry-sdk[aiohttp]\"\npip install \"sentry-sdk[tornado]\"\n\n# Multiple extras:\npip install \"sentry-sdk[django,celery]\"\n```\n\n> Extras are optional — plain `sentry-sdk` works for all frameworks. Extras install complementary packages.\n\n### Quick Start — Recommended Init\n\nFull init enabling the most features with sensible defaults. Place **before** any app\u002Fframework code:\n\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    dsn=os.environ[\"SENTRY_DSN\"],\n    environment=os.environ.get(\"SENTRY_ENVIRONMENT\", \"production\"),\n    release=os.environ.get(\"SENTRY_RELEASE\"),   # e.g. \"myapp@1.0.0\"\n    send_default_pii=True,\n\n    # Tracing (lower to 0.1–0.2 in high-traffic production)\n    traces_sample_rate=1.0,\n\n    # Profiling — continuous, tied to active spans\n    profile_session_sample_rate=1.0,\n    profile_lifecycle=\"trace\",\n\n    # Structured logs (SDK ≥ 2.35.0)\n    enable_logs=True,\n)\n```\n\n### Where to Initialize Per Framework\n\n| Framework | Where to call `sentry_sdk.init()` | Notes |\n|-----------|-----------------------------------|-------|\n| **Django** | Top of `settings.py`, before any imports | No middleware needed — Sentry patches Django internally |\n| **Flask** | Before `app = Flask(__name__)` | Must precede app creation |\n| **FastAPI** | Before `app = FastAPI()` | `StarletteIntegration` + `FastApiIntegration` auto-enabled together |\n| **Starlette** | Before `app = Starlette(...)` | Same auto-integration as FastAPI |\n| **AIOHTTP** | Module level, before `web.Application()` | |\n| **Tornado** | Module level, before app setup | No integration class needed |\n| **Quart** | Before `app = Quart(__name__)` | |\n| **Falcon** | Module level, before `app = falcon.App()` | |\n| **Sanic** | Inside `@app.listener(\"before_server_start\")` | Sanic's lifecycle requires async init |\n| **Celery** | `@signals.celeryd_init.connect` in worker AND in calling process | Dual-process init required |\n| **RQ** | `mysettings.py` loaded by worker via `rq worker -c mysettings` | |\n| **ARQ** | Both worker module and enqueuing process | |\n\n**Django example** (`settings.py`):\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    dsn=os.environ[\"SENTRY_DSN\"],\n    send_default_pii=True,\n    traces_sample_rate=1.0,\n    profile_session_sample_rate=1.0,\n    profile_lifecycle=\"trace\",\n    enable_logs=True,\n)\n\n# rest of Django settings...\nINSTALLED_APPS = [...]\n```\n\n**FastAPI example** (`main.py`):\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    dsn=os.environ[\"SENTRY_DSN\"],\n    send_default_pii=True,\n    traces_sample_rate=1.0,\n    profile_session_sample_rate=1.0,\n    profile_lifecycle=\"trace\",\n    enable_logs=True,\n)\n\nfrom fastapi import FastAPI\napp = FastAPI()\n```\n\n### Auto-Enabled vs Explicit Integrations\n\nMost integrations activate automatically when their package is installed — no `integrations=[...]` needed:\n\n| Auto-enabled | Explicit required |\n|-------------|-------------------|\n| Django, Flask, FastAPI, Starlette, AIOHTTP, Tornado, Quart, Falcon, Sanic, Bottle | `DramatiqIntegration` |\n| Celery, RQ, Huey, ARQ | `GRPCIntegration` |\n| SQLAlchemy, Redis, asyncpg, pymongo | `StrawberryIntegration` |\n| Requests, HTTPX, aiohttp-client | `AsyncioIntegration` |\n| OpenAI, Anthropic, LangChain, Pydantic AI, MCP | `OpenTelemetryIntegration` |\n| Python `logging`, Loguru | `WSGIIntegration` \u002F `ASGIIntegration` |\n\n### For Each Agreed Feature\n\nWalk through features one at a time. Load the reference, follow its steps, verify before moving on:\n\n| Feature | Reference file | Load when... |\n|---------|---------------|-------------|\n| Error Monitoring | `${SKILL_ROOT}\u002Freferences\u002Ferror-monitoring.md` | Always (baseline) |\n| Tracing | `${SKILL_ROOT}\u002Freferences\u002Ftracing.md` | HTTP handlers \u002F distributed tracing |\n| Profiling | `${SKILL_ROOT}\u002Freferences\u002Fprofiling.md` | Performance-sensitive production |\n| Logging | `${SKILL_ROOT}\u002Freferences\u002Flogging.md` | Always; enhanced for Loguru |\n| Metrics | `${SKILL_ROOT}\u002Freferences\u002Fmetrics.md` | Business KPIs \u002F SLO tracking |\n| Crons | `${SKILL_ROOT}\u002Freferences\u002Fcrons.md` | Scheduler \u002F cron patterns detected |\n| AI Monitoring | `${SKILL_ROOT}\u002Freferences\u002Fai-monitoring.md` | AI library detected |\n\nFor each feature: `Read ${SKILL_ROOT}\u002Freferences\u002F\u003Cfeature>.md`, follow steps exactly, verify it works.\n\n---\n\n## Configuration Reference\n\n### Key `sentry_sdk.init()` Options\n\n| Option | Type | Default | Purpose |\n|--------|------|---------|---------|\n| `dsn` | `str` | `None` | SDK disabled if empty; env: `SENTRY_DSN` |\n| `environment` | `str` | `\"production\"` | e.g., `\"staging\"`; env: `SENTRY_ENVIRONMENT` |\n| `release` | `str` | `None` | e.g., `\"myapp@1.0.0\"`; env: `SENTRY_RELEASE` |\n| `send_default_pii` | `bool` | `False` | Include IP, headers, cookies, auth user |\n| `traces_sample_rate` | `float` | `None` | Transaction sample rate; `None` disables tracing |\n| `traces_sampler` | `Callable` | `None` | Custom per-transaction sampling (overrides rate) |\n| `profile_session_sample_rate` | `float` | `None` | Continuous profiling session rate |\n| `profile_lifecycle` | `str` | `\"manual\"` | `\"trace\"` = auto-start profiler with spans |\n| `profiles_sample_rate` | `float` | `None` | Transaction-based profiling rate |\n| `enable_logs` | `bool` | `False` | Send logs to Sentry (SDK ≥ 2.35.0) |\n| `sample_rate` | `float` | `1.0` | Error event sample rate |\n| `attach_stacktrace` | `bool` | `False` | Stack traces on `capture_message()` |\n| `max_breadcrumbs` | `int` | `100` | Max breadcrumbs per event |\n| `debug` | `bool` | `False` | Verbose SDK debug output |\n| `before_send` | `Callable` | `None` | Hook to mutate\u002Fdrop error events |\n| `before_send_transaction` | `Callable` | `None` | Hook to mutate\u002Fdrop transaction events |\n| `ignore_errors` | `list` | `[]` | Exception types or regex patterns to suppress |\n| `auto_enabling_integrations` | `bool` | `True` | Set `False` to disable all auto-detection |\n\n### Environment Variables\n\n| Variable | Maps to | Notes |\n|----------|---------|-------|\n| `SENTRY_DSN` | `dsn` | |\n| `SENTRY_RELEASE` | `release` | Also auto-detected from git SHA, Heroku, CircleCI, CodeBuild, GAE |\n| `SENTRY_ENVIRONMENT` | `environment` | |\n| `SENTRY_DEBUG` | `debug` | |\n\n---\n\n## Verification\n\nTest that Sentry is receiving events:\n\n```python\n# Trigger a real error event — check dashboard within seconds\ndivision_by_zero = 1 \u002F 0\n```\n\nOr for a non-crashing check:\n```python\nsentry_sdk.capture_message(\"Sentry Python SDK test\")\n```\n\nIf nothing appears:\n1. Set `debug=True` in `sentry_sdk.init()` — prints SDK internals to stdout\n2. Verify the DSN is correct\n3. Check `SENTRY_DSN` env var is set in the running process\n4. For Celery\u002FRQ: ensure init runs in the **worker** process, not just the calling process\n\n---\n\n## Phase 4: Cross-Link\n\nAfter completing Python setup, check for a companion frontend missing Sentry:\n\n```bash\nls frontend\u002F web\u002F client\u002F ui\u002F 2>\u002Fdev\u002Fnull\ncat frontend\u002Fpackage.json web\u002Fpackage.json client\u002Fpackage.json 2>\u002Fdev\u002Fnull \\\n  | grep -E '\"react\"|\"svelte\"|\"vue\"|\"next\"|\"nuxt\"'\n```\n\nIf a frontend exists without Sentry, suggest the matching skill:\n\n| Frontend detected | Suggest skill |\n|-------------------|--------------|\n| React \u002F Next.js | `sentry-react-sdk` |\n| Svelte \u002F SvelteKit | `sentry-svelte-sdk` |\n| Vue \u002F Nuxt | Use `@sentry\u002Fvue` — see [docs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fvue\u002F](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fvue\u002F) |\n| Other JS\u002FTS | `sentry-react-sdk` (covers generic browser JS patterns) |\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Events not appearing | Set `debug=True`, verify DSN, check env vars in the running process |\n| Malformed DSN error | Format: `https:\u002F\u002F\u003Ckey>@o\u003Corg>.ingest.sentry.io\u002F\u003Cproject>` |\n| Django exceptions not captured | Ensure `sentry_sdk.init()` is at the **top** of `settings.py` before other imports |\n| Flask exceptions not captured | Init must happen **before** `app = Flask(__name__)` |\n| FastAPI exceptions not captured | Init before `app = FastAPI()`; both `StarletteIntegration` and `FastApiIntegration` auto-enabled |\n| Celery task errors not captured | Must call `sentry_sdk.init()` in the **worker process** via `celeryd_init` signal |\n| Sanic init not working | Init must be inside `@app.listener(\"before_server_start\")`, not module level |\n| uWSGI not capturing | Add `--enable-threads --py-call-uwsgi-fork-hooks` to uWSGI command |\n| No traces appearing | Verify `traces_sample_rate` is set (not `None`); check that the integration is auto-enabled |\n| Profiling not starting | Requires `traces_sample_rate > 0` + either `profile_session_sample_rate` or `profiles_sample_rate` |\n| `enable_logs` not working | Requires SDK ≥ 2.35.0; for direct structured logs use `sentry_sdk.logger`; for stdlib bridging use `LoggingIntegration(sentry_logs_level=...)` |\n| Too many transactions | Lower `traces_sample_rate` or use `traces_sampler` to drop health checks |\n| Cross-request data leaking | Don't use `get_global_scope()` for per-request data — use `get_isolation_scope()` |\n| RQ worker not reporting | Pass `--sentry-dsn=\"\"` to disable RQ's own Sentry shortcut; init via settings file instead |\n","# Sentry Python SDK\n\nOpinionated wizard that scans your Python project and guides you through complete Sentry setup.\n\n## Invoke This Skill When\n\n- User asks to \"add Sentry to Python\" or \"setup Sentry\" in a Python app\n- User wants error monitoring, tracing, profiling, logging, metrics, or crons in Python\n- User mentions `sentry-sdk`, `sentry_sdk`, or Sentry + any Python framework\n- User wants to monitor Django views, Flask routes, FastAPI endpoints, Celery tasks, or scheduled jobs\n\n> **Note:** SDK versions and APIs below reflect Sentry docs at time of writing (sentry-sdk 2.x).\n> Always verify against [docs.sentry.io\u002Fplatforms\u002Fpython\u002F](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fpython\u002F) before implementing.\n\n---\n\n## Phase 1: Detect\n\nRun these commands to understand the project before making recommendations:\n\n```bash\n# Check existing Sentry\ngrep -i sentry requirements.txt pyproject.toml setup.cfg setup.py 2>\u002Fdev\u002Fnull\n\n# Detect web framework\ngrep -rE \"django|flask|fastapi|starlette|aiohttp|tornado|quart|falcon|sanic|bottle\" \\\n  requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Detect task queues\ngrep -rE \"celery|rq|huey|arq|dramatiq\" requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Detect logging libraries\ngrep -E \"loguru\" requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Detect AI libraries\ngrep -rE \"openai|anthropic|langchain|huggingface|google-genai|pydantic-ai|litellm\" \\\n  requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Detect schedulers \u002F crons\ngrep -rE \"celery|apscheduler|schedule|crontab\" requirements.txt pyproject.toml 2>\u002Fdev\u002Fnull\n\n# Check for companion frontend\nls frontend\u002F web\u002F client\u002F ui\u002F static\u002F templates\u002F 2>\u002Fdev\u002Fnull\n```\n\n**What to note:**\n- Is `sentry-sdk` already in requirements? If yes, check if `sentry_sdk.init()` is present — may just need feature config.\n- Which framework? (Determines where to place `sentry_sdk.init()`.)\n- Which task queue? (Celery needs dual-process init; RQ needs a settings file.)\n- AI libraries? (OpenAI, Anthropic, LangChain are auto-instrumented.)\n- Companion frontend? (Triggers Phase 4 cross-link.)\n\n---\n\n## Phase 2: Recommend\n\nBased on what you found, present a concrete proposal. Don't ask open-ended questions — lead with a recommendation:\n\n**Always recommended (core coverage):**\n- ✅ **Error Monitoring** — captures unhandled exceptions, supports `ExceptionGroup` (Python 3.11+)\n- ✅ **Logging** — Python `logging` stdlib auto-captured; enhanced if Loguru detected\n\n**Recommend when detected:**\n- ✅ **Tracing** — HTTP framework detected (Django\u002FFlask\u002FFastAPI\u002Fetc.)\n- ✅ **AI Monitoring** — OpenAI\u002FAnthropic\u002FLangChain\u002Fetc. detected (auto-instrumented, zero config)\n- ⚡ **Profiling** — production apps where performance matters\n- ⚡ **Crons** — Celery Beat, APScheduler, or cron patterns detected\n- ⚡ **Metrics** — business KPIs, SLO tracking\n\n**Recommendation matrix:**\n\n| Feature | Recommend when... | Reference |\n|---------|------------------|-----------|\n| Error Monitoring | **Always** — non-negotiable baseline | `${SKILL_ROOT}\u002Freferences\u002Ferror-monitoring.md` |\n| Tracing | Django\u002FFlask\u002FFastAPI\u002FAIOHTTP\u002Fetc. detected | `${SKILL_ROOT}\u002Freferences\u002Ftracing.md` |\n| Profiling | Production + performance-sensitive workload | `${SKILL_ROOT}\u002Freferences\u002Fprofiling.md` |\n| Logging | Always (stdlib); enhanced for Loguru | `${SKILL_ROOT}\u002Freferences\u002Flogging.md` |\n| Metrics | Business events or SLO tracking needed | `${SKILL_ROOT}\u002Freferences\u002Fmetrics.md` |\n| Crons | Celery Beat, APScheduler, or cron patterns | `${SKILL_ROOT}\u002Freferences\u002Fcrons.md` |\n| AI Monitoring | OpenAI\u002FAnthropic\u002FLangChain\u002Fetc. detected | `${SKILL_ROOT}\u002Freferences\u002Fai-monitoring.md` |\n\nPropose: *\"I recommend Error Monitoring + Tracing [+ Logging if applicable]. Want Profiling, Crons, or AI Monitoring too?\"*\n\n---\n\n## Phase 3: Guide\n\n### Install\n\n```bash\n# Core SDK (always required)\npip install sentry-sdk\n\n# Optional extras (install only what matches detected framework):\npip install \"sentry-sdk[django]\"\npip install \"sentry-sdk[flask]\"\npip install \"sentry-sdk[fastapi]\"\npip install \"sentry-sdk[celery]\"\npip install \"sentry-sdk[aiohttp]\"\npip install \"sentry-sdk[tornado]\"\n\n# Multiple extras:\npip install \"sentry-sdk[django,celery]\"\n```\n\n> Extras are optional — plain `sentry-sdk` works for all frameworks. Extras install complementary packages.\n\n### Quick Start — Recommended Init\n\nFull init enabling the most features with sensible defaults. Place **before** any app\u002Fframework code:\n\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    dsn=os.environ[\"SENTRY_DSN\"],\n    environment=os.environ.get(\"SENTRY_ENVIRONMENT\", \"production\"),\n    release=os.environ.get(\"SENTRY_RELEASE\"),   # e.g. \"myapp@1.0.0\"\n    send_default_pii=True,\n\n    # Tracing (lower to 0.1–0.2 in high-traffic production)\n    traces_sample_rate=1.0,\n\n    # Profiling — continuous, tied to active spans\n    profile_session_sample_rate=1.0,\n    profile_lifecycle=\"trace\",\n\n    # Structured logs (SDK ≥ 2.35.0)\n    enable_logs=True,\n)\n```\n\n### Where to Initialize Per Framework\n\n| Framework | Where to call `sentry_sdk.init()` | Notes |\n|-----------|-----------------------------------|-------|\n| **Django** | Top of `settings.py`, before any imports | No middleware needed — Sentry patches Django internally |\n| **Flask** | Before `app = Flask(__name__)` | Must precede app creation |\n| **FastAPI** | Before `app = FastAPI()` | `StarletteIntegration` + `FastApiIntegration` auto-enabled together |\n| **Starlette** | Before `app = Starlette(...)` | Same auto-integration as FastAPI |\n| **AIOHTTP** | Module level, before `web.Application()` | |\n| **Tornado** | Module level, before app setup | No integration class needed |\n| **Quart** | Before `app = Quart(__name__)` | |\n| **Falcon** | Module level, before `app = falcon.App()` | |\n| **Sanic** | Inside `@app.listener(\"before_server_start\")` | Sanic's lifecycle requires async init |\n| **Celery** | `@signals.celeryd_init.connect` in worker AND in calling process | Dual-process init required |\n| **RQ** | `mysettings.py` loaded by worker via `rq worker -c mysettings` | |\n| **ARQ** | Both worker module and enqueuing process | |\n\n**Django example** (`settings.py`):\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    dsn=os.environ[\"SENTRY_DSN\"],\n    send_default_pii=True,\n    traces_sample_rate=1.0,\n    profile_session_sample_rate=1.0,\n    profile_lifecycle=\"trace\",\n    enable_logs=True,\n)\n\n# rest of Django settings...\nINSTALLED_APPS = [...]\n```\n\n**FastAPI example** (`main.py`):\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    dsn=os.environ[\"SENTRY_DSN\"],\n    send_default_pii=True,\n    traces_sample_rate=1.0,\n    profile_session_sample_rate=1.0,\n    profile_lifecycle=\"trace\",\n    enable_logs=True,\n)\n\nfrom fastapi import FastAPI\napp = FastAPI()\n```\n\n### Auto-Enabled vs Explicit Integrations\n\nMost integrations activate automatically when their package is installed — no `integrations=[...]` needed:\n\n| Auto-enabled | Explicit required |\n|-------------|-------------------|\n| Django, Flask, FastAPI, Starlette, AIOHTTP, Tornado, Quart, Falcon, Sanic, Bottle | `DramatiqIntegration` |\n| Celery, RQ, Huey, ARQ | `GRPCIntegration` |\n| SQLAlchemy, Redis, asyncpg, pymongo | `StrawberryIntegration` |\n| Requests, HTTPX, aiohttp-client | `AsyncioIntegration` |\n| OpenAI, Anthropic, LangChain, Pydantic AI, MCP | `OpenTelemetryIntegration` |\n| Python `logging`, Loguru | `WSGIIntegration` \u002F `ASGIIntegration` |\n\n### For Each Agreed Feature\n\nWalk through features one at a time. Load the reference, follow its steps, verify before moving on:\n\n| Feature | Reference file | Load when... |\n|---------|---------------|-------------|\n| Error Monitoring | `${SKILL_ROOT}\u002Freferences\u002Ferror-monitoring.md` | Always (baseline) |\n| Tracing | `${SKILL_ROOT}\u002Freferences\u002Ftracing.md` | HTTP handlers \u002F distributed tracing |\n| Profiling | `${SKILL_ROOT}\u002Freferences\u002Fprofiling.md` | Performance-sensitive production |\n| Logging | `${SKILL_ROOT}\u002Freferences\u002Flogging.md` | Always; enhanced for Loguru |\n| Metrics | `${SKILL_ROOT}\u002Freferences\u002Fmetrics.md` | Business KPIs \u002F SLO tracking |\n| Crons | `${SKILL_ROOT}\u002Freferences\u002Fcrons.md` | Scheduler \u002F cron patterns detected |\n| AI Monitoring | `${SKILL_ROOT}\u002Freferences\u002Fai-monitoring.md` | AI library detected |\n\nFor each feature: `Read ${SKILL_ROOT}\u002Freferences\u002F\u003Cfeature>.md`, follow steps exactly, verify it works.\n\n---\n\n## Configuration Reference\n\n### Key `sentry_sdk.init()` Options\n\n| Option | Type | Default | Purpose |\n|--------|------|---------|---------|\n| `dsn` | `str` | `None` | SDK disabled if empty; env: `SENTRY_DSN` |\n| `environment` | `str` | `\"production\"` | e.g., `\"staging\"`; env: `SENTRY_ENVIRONMENT` |\n| `release` | `str` | `None` | e.g., `\"myapp@1.0.0\"`; env: `SENTRY_RELEASE` |\n| `send_default_pii` | `bool` | `False` | Include IP, headers, cookies, auth user |\n| `traces_sample_rate` | `float` | `None` | Transaction sample rate; `None` disables tracing |\n| `traces_sampler` | `Callable` | `None` | Custom per-transaction sampling (overrides rate) |\n| `profile_session_sample_rate` | `float` | `None` | Continuous profiling session rate |\n| `profile_lifecycle` | `str` | `\"manual\"` | `\"trace\"` = auto-start profiler with spans |\n| `profiles_sample_rate` | `float` | `None` | Transaction-based profiling rate |\n| `enable_logs` | `bool` | `False` | Send logs to Sentry (SDK ≥ 2.35.0) |\n| `sample_rate` | `float` | `1.0` | Error event sample rate |\n| `attach_stacktrace` | `bool` | `False` | Stack traces on `capture_message()` |\n| `max_breadcrumbs` | `int` | `100` | Max breadcrumbs per event |\n| `debug` | `bool` | `False` | Verbose SDK debug output |\n| `before_send` | `Callable` | `None` | Hook to mutate\u002Fdrop error events |\n| `before_send_transaction` | `Callable` | `None` | Hook to mutate\u002Fdrop transaction events |\n| `ignore_errors` | `list` | `[]` | Exception types or regex patterns to suppress |\n| `auto_enabling_integrations` | `bool` | `True` | Set `False` to disable all auto-detection |\n\n### Environment Variables\n\n| Variable | Maps to | Notes |\n|----------|---------|-------|\n| `SENTRY_DSN` | `dsn` | |\n| `SENTRY_RELEASE` | `release` | Also auto-detected from git SHA, Heroku, CircleCI, CodeBuild, GAE |\n| `SENTRY_ENVIRONMENT` | `environment` | |\n| `SENTRY_DEBUG` | `debug` | |\n\n---\n\n## Verification\n\nTest that Sentry is receiving events:\n\n```python\n# Trigger a real error event — check dashboard within seconds\ndivision_by_zero = 1 \u002F 0\n```\n\nOr for a non-crashing check:\n```python\nsentry_sdk.capture_message(\"Sentry Python SDK test\")\n```\n\nIf nothing appears:\n1. Set `debug=True` in `sentry_sdk.init()` — prints SDK internals to stdout\n2. Verify the DSN is correct\n3. Check `SENTRY_DSN` env var is set in the running process\n4. For Celery\u002FRQ: ensure init runs in the **worker** process, not just the calling process\n\n---\n\n## Phase 4: Cross-Link\n\nAfter completing Python setup, check for a companion frontend missing Sentry:\n\n```bash\nls frontend\u002F web\u002F client\u002F ui\u002F 2>\u002Fdev\u002Fnull\ncat frontend\u002Fpackage.json web\u002Fpackage.json client\u002Fpackage.json 2>\u002Fdev\u002Fnull \\\n  | grep -E '\"react\"|\"svelte\"|\"vue\"|\"next\"|\"nuxt\"'\n```\n\nIf a frontend exists without Sentry, suggest the matching skill:\n\n| Frontend detected | Suggest skill |\n|-------------------|--------------|\n| React \u002F Next.js | `sentry-react-sdk` |\n| Svelte \u002F SvelteKit | `sentry-svelte-sdk` |\n| Vue \u002F Nuxt | Use `@sentry\u002Fvue` — see [docs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fvue\u002F](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fvue\u002F) |\n| Other JS\u002FTS | `sentry-react-sdk` (covers generic browser JS patterns) |\n\n---\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Events not appearing | Set `debug=True`, verify DSN, check env vars in the running process |\n| Malformed DSN error | Format: `https:\u002F\u002F\u003Ckey>@o\u003Corg>.ingest.sentry.io\u002F\u003Cproject>` |\n| Django exceptions not captured | Ensure `sentry_sdk.init()` is at the **top** of `settings.py` before other imports |\n| Flask exceptions not captured | Init must happen **before** `app = Flask(__name__)` |\n| FastAPI exceptions not captured | Init before `app = FastAPI()`; both `StarletteIntegration` and `FastApiIntegration` auto-enabled |\n| Celery task errors not captured | Must call `sentry_sdk.init()` in the **worker process** via `celeryd_init` signal |\n| Sanic init not working | Init must be inside `@app.listener(\"before_server_start\")`, not module level |\n| uWSGI not capturing | Add `--enable-threads --py-call-uwsgi-fork-hooks` to uWSGI command |\n| No traces appearing | Verify `traces_sample_rate` is set (not `None`); check that the integration is auto-enabled |\n| Profiling not starting | Requires `traces_sample_rate > 0` + either `profile_session_sample_rate` or `profiles_sample_rate` |\n| `enable_logs` not working | Requires SDK ≥ 2.35.0; for direct structured logs use `sentry_sdk.logger`; for stdlib bridging use `LoggingIntegration(sentry_logs_level=...)` |\n| Too many transactions | Lower `traces_sample_rate` or use `traces_sampler` to drop health checks |\n| Cross-request data leaking | Don't use `get_global_scope()` for per-request data — use `get_isolation_scope()` |\n| RQ worker not reporting | Pass `--sentry-dsn=\"\"` to disable RQ's own Sentry shortcut; init via settings file instead |\n",{"name":5,"license":15,"description":7},"main","fbfb242f793fdf040f3a1a6b100896c188c228c8","_Engineering\u002Fsentry-python",1,"https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog","https:\u002F\u002Fgithub.com\u002Fvitalikpestov","Listing on crypto exchanges","2026-06-15 22:12:56",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add vitalikpestov\u002FSkills-Catalog --skill sentry-python-sdk",{"tool":58,"command":59},"bunx","bunx skills add vitalikpestov\u002FSkills-Catalog --skill sentry-python-sdk",{"tool":61,"command":62},"pnpm","pnpm dlx skills add vitalikpestov\u002FSkills-Catalog --skill sentry-python-sdk","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Engineering\u002Fsentry-python\u002FSKILL.md",true,[],[67,95,120,137,160,187],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":39},"01M71V1MC994P553631JZSWVYD","solana-dev","Use when user asks to \"build a Solana dapp\", \"write an Anchor program\", \"create a token\", \"debug Solana errors\", \"set up wallet connection\", \"test my Solana program\", \"deploy to devnet\", or \"explain Solana concepts\" (rent, accounts, PDAs, CPIs, etc.). End-to-end Solana development playbook covering wallet connection, Anchor\u002FPinocchio programs, Codama client generation, LiteSVM\u002FMollusk\u002FSurfpool testing, and security checklists. Integrates with the Solana MCP server for live documentation search. Prefers framework-kit (@solana\u002Fclient + @solana\u002Freact-hooks) for UI, wallet-standard-first connection (incl. ConnectorKit), @solana\u002Fkit for client\u002FRPC code, and @solana\u002Fweb3-compat for legacy boundaries.","MIT","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Web3\u002Fsolana-dev\u002Fskill\u002FSKILL.md",[],[75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94],"dev","solana dev","solana","Wallet","search","testing","solana cli","kit","MCP","web3","react","create","server","write","playbook","live","security","ui","concepts","toolchain",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":39},"01M71TYQPHE2YGKTT7DG9QCW3K","generating-trading-signals","Generate trading signals using technical indicators (RSI, MACD, Bollinger Bands, etc.).\nCombines multiple indicators into composite signals with confidence scores.\nUse when analyzing assets for trading opportunities or checking technical indicators.\nTrigger with phrases like \"get trading signals\", \"check indicators\", \"analyze for entry\",\n\"scan for opportunities\", \"generate buy\u002Fsell signals\", or \"technical analysis\".","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Trading-Finance\u002Fgenerating-trading-signals\u002FSKILL.md",[],[102,103,104,105,106,107,108,109,110,111,21,112,113,35,114,115,116,117,118,119],"generating trading signals","signals","trading signals","trading","get","technical indicators","for","scan","rsi","trigger","technical","use","Bash","analysis","code","io","check","analyze",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":39},"01M71TY4CR3GKGQ3M12X9WN95Y","prediction-monitor","Prediction Monitor - Auto-activating skill for ML Deployment.\nTriggers on: prediction monitor, prediction monitor\nPart of the ML Deployment skill category.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Trading-Finance\u002FAI Predictions\u002Fprediction-monitor\u002FSKILL.md",[],[127,128,129,108,130,131,88,132,133,134,135,136,114],"prediction","monitor","prediction monitor","deployment","read","edit","triggers","grep","auto","ml",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":39},"01M71TXD9MYXZC39HCPP909HTZ","strategy-advisor","High-level strategic thinking and business decision guidance for planning and direction-setting.\nUse when: making strategic decisions, evaluating business options, setting direction, analyzing\ntrade-offs, or when user mentions strategy, business planning, competitive analysis, or long-term planning.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Fstrategy-advisor\u002FSKILL.md",[],[144,145,146,147,148,149,150,151,152,108,153,154,155,113,156,157,35,158,115,159],"strategy advisor","strategy","advisor","competitive","setting","thinking","planning","direction","trade-offs","long","decision","strategic","business","apps","decisions","trade",{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":164,"sourceHtmlUrl":165,"categories":166,"keywords":167,"publishedAt":39},"01M71TWHBT2R1P1FNWTW67ZREP","app-paywall-pilot","Design, audit, debug, and implement App Store-compliant mobile paywalls, subscription flows, pricing screens, trials, offers, feature gates, and subscription lifecycle UX. Use when the user asks to audit my paywall, fix App Store 3.1.2 rejection, improve trial-to-paid, choose plans\u002Fprices\u002Ftrials, review RevenueCat\u002FAdapty\u002FApphud\u002FSuperwall setup, calculate LTV\u002FROAS, or build paywall implementation.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffrom-dosesync\u002Fapp-paywall-pilot\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffrom-dosesync\u002Fapp-paywall-pilot\u002FSKILL.md",[],[168,169,170,171,172,173,174,175,176,177,178,179,35,180,181,182,183,184,185,186],"app","paywall","app paywall pilot","paid","paywalls","prices","choose","flows","fix","improve","design","app store","review","audit","ux","subscription","mobile","my","calculate",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":191,"sourceHtmlUrl":192,"categories":193,"keywords":194,"publishedAt":39},"01M71TWET8GFKEB7ZHJPMQX29V","figma","Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffigma\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fvitalikpestov\u002FSkills-Catalog\u002Fblob\u002Fmain\u002F_Product-Apps\u002Ffigma\u002FSKILL.md",[],[189,195,196,197,198,111,178,83,113,35,199,200,116,201,87,202,203,204,205,206],"fetch","ids","mcp setup","translate","mcp server","Variables","task","Nodes","figma mcp","code implementation","node","assets"]