GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Get Started
  • SDKs
  • Product
  • AI
  • API
  • Go to Sentry

This view

  • Original page
  • New address

GeezerVison is showing docs.sentry.io — Integrations | Sentry for Python

  • Home
  • Platforms
  • Python
  • Integrations

Integrations for Python

Sentry provides additional integrations designed to change configuration or add instrumentation to your application.

The Sentry SDK uses integrations to hook into the functionality of popular libraries to automatically instrument your application and give you the best data out of the box.

The tables on this page show which integrations are auto-enabled in the current major version (3.x) of the Python SDK. For 2.x, switch to 2.x in the version selector.

Available Integrations

Web Frameworks

Auto-enabled
python.django iconDjango✓
python.flask iconFlask✓
python.fastapi iconFastAPI✓
python.aiohttp iconAIOHTTP✓
python.bottle iconBottle✓
python.falcon iconFalcon✓
python.pyramid iconPyramid✓
python.quart iconQuart✓
python.sanic iconSanic✓
python.starlette iconStarlette✓
python.starlite iconStarlite✓
python.litestar iconLitestar✓
python.tornado iconTornado✓

Databases

Auto-enabled
python.aiomysql iconaiomysql
python.asyncpg iconasyncpg✓
python.clickhouse-driver iconClickHouse✓
python.pymongo iconMongoDB✓
python.redis iconRedis✓
python.sqlalchemy iconSQLAlchemy✓

AI

Auto-enabled
aws iconAmazon Bedrock✓
anthropic iconAnthropic✓
google-genai iconGoogle Gen AI✓
huggingface_hub iconHugging Face Hub✓
openai iconOpenAI✓
openai-agents iconOpenAI Agents SDK✓
langchain iconLangChain✓
langgraph iconLangGraph✓
litellm iconLiteLLM
pydantic-ai iconPydantic AI✓
python.mistral iconMistral
mcp iconMCP (Model Context Protocol)✓
typesafe-ai iconTypeSafe AI

Data Processing

Auto-enabled
python.airflow iconApache Airflow
python.beam iconApache Beam
python.spark iconApache Spark
python.arq iconARQ✓
python.celery iconCelery✓
python.dramatiq iconDramatiq
python.huey iconhuey✓
python.rq iconRQ✓
python.ray iconRay

Feature Flags

Auto-enabled
python iconLaunchDarkly
python iconOpenFeature
python iconStatsig
python iconUnleash

Cloud Computing

Auto-enabled
python.awslambda iconAWS Lambda
python.boto3 iconBoto3✓
python.chalice iconChalice✓
python.cloudresourcecontext iconCloud Resource Context
python.gcpfunctions iconGoogle Cloud Functions
python.serverless iconServerless Framework

HTTP Clients

Auto-enabled
python.aiohttp iconAIOHTTP✓
python.httpx iconHTTPX✓
python iconHTTPX2✓
python iconpyreqwest
Python standard HTTP client (in the Default Integrations)✓
Requests HTTP instrumentation is done via the Default Integrations.✓

GraphQL

Auto-enabled
python.ariadne iconAriadne✓
python.gql iconGQL✓
python.graphene iconGraphene✓
python.strawberry iconStrawberry

RPC

Auto-enabled
python.grpc icongRPC

Logging

Auto-enabled
python.logging iconLogging
python.loguru iconLoguru

Miscellaneous

Auto-enabled
python.asgi iconASGI
python.asyncio iconasyncio
python.opentelemetry iconOpentelemetry (OTLP)
python.pure_eval iconEnhanced Locals
python.gnu_backtrace iconGNU Backtrace
python.rust_tracing iconRust Tracing
python.socket iconSocket
python.sys_exit iconsys.exit
python.tryton iconTryton
python.typer iconTyper
python.wsgi iconWSGI

Default Integrations

Integration
Argv
Atexit
Excepthook
Deduplication
Stdlib
Modules
Logging
Threading

Configuration

Enabling Integrations

Integrations can be added using the integrations config option.

Integrations marked as "auto-enabled" in the above table will be turned on automatically, unless you set auto_enabling_integrations to False. If you want to configure a specific integration's settings (for instance, change Flask's default transaction_style), add it to your integrations list as you would a non-auto-enabling integration and pass in the desired options.

Copied
import sentry_sdk
from sentry_sdk.integrations.asyncio import AsyncioIntegration
from sentry_sdk.integrations.flask import FlaskIntegration

sentry_sdk.init(
    integrations=[
        # The Flask integration is auto-enabling, but we want to change
        # transaction_style from the default "endpoint" to "url"
        FlaskIntegration(transaction_style="url"),
        # The asyncio integration is not enabled automatically
        # and needs to be added manually.
        AsyncioIntegration(),
    ],
)
import sentry_sdk
from sentry_sdk.integrations.asyncio import AsyncioIntegration
from sentry_sdk.integrations.flask import FlaskIntegration

sentry_sdk.init(
    integrations=[
        # The Flask integration is auto-enabling, but we want to change
        # transaction_style from the default "endpoint" to "url"
        FlaskIntegration(transaction_style="url"),
        # The asyncio integration is not enabled automatically
        # and needs to be added manually.
        AsyncioIntegration(),
    ],
)

Disabling Integrations

To disable an integration, use the disabled_integrations config option:

Copied
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration

sentry_sdk.init(
    # Do not use the Flask integration even if Flask is installed.
    disabled_integrations=[
        FlaskIntegration(),
    ],
)
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration

sentry_sdk.init(
    # Do not use the Flask integration even if Flask is installed.
    disabled_integrations=[
        FlaskIntegration(),
    ],
)

It's also possible to disable all automatically-added integrations. There are two types:

  • Auto-enabled integrations like FlaskIntegration are automatically added if the SDK detects that you have a corresponding package (like Flask) installed. This happens when the auto_enabling_integrations option is set to True (default).
  • Default integrations like logging or excepthook are always enabled, regardless of what packages you have installed, as long as the default_integrations option is True (default). They provide essential SDK functionality like error deduplication or event flushing at interpreter shutdown.

To disable all auto-enabling integrations, you can use the auto_enabling_integrations option:

Copied
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration

sentry_sdk.init(
    # Turn off all auto-enabling integrations except for Flask
    auto_enabling_integrations=False,
    integrations=[
        FlaskIntegration(),
    ],
)
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration

sentry_sdk.init(
    # Turn off all auto-enabling integrations except for Flask
    auto_enabling_integrations=False,
    integrations=[
        FlaskIntegration(),
    ],
)

To disable all default integrations, set default_integrations to False. Note that this disables all automatically added integrations, both default and auto-enabling. Any integrations you want to use then have to be manually specified via the integrations config option.

Copied
import sentry_sdk
from sentry_sdk.integrations.atexit import AtexitIntegration
from sentry_sdk.integrations.argv import ArgvIntegration
from sentry_sdk.integrations.dedupe import DedupeIntegration
from sentry_sdk.integrations.excepthook import ExcepthookIntegration
from sentry_sdk.integrations.stdlib import StdlibIntegration
from sentry_sdk.integrations.modules import ModulesIntegration
from sentry_sdk.integrations.threading import ThreadingIntegration

sentry_sdk.init(
    # Turn off the default logging integration, but keep the rest.
    default_integrations=False,
    integrations=[
        AtexitIntegration(),
        ArgvIntegration(),
        DedupeIntegration(),
        ExcepthookIntegration(),
        StdlibIntegration(),
        ModulesIntegration(),
        ThreadingIntegration(),
    ],
)
import sentry_sdk
from sentry_sdk.integrations.atexit import AtexitIntegration
from sentry_sdk.integrations.argv import ArgvIntegration
from sentry_sdk.integrations.dedupe import DedupeIntegration
from sentry_sdk.integrations.excepthook import ExcepthookIntegration
from sentry_sdk.integrations.stdlib import StdlibIntegration
from sentry_sdk.integrations.modules import ModulesIntegration
from sentry_sdk.integrations.threading import ThreadingIntegration

sentry_sdk.init(
    # Turn off the default logging integration, but keep the rest.
    default_integrations=False,
    integrations=[
        AtexitIntegration(),
        ArgvIntegration(),
        DedupeIntegration(),
        ExcepthookIntegration(),
        StdlibIntegration(),
        ModulesIntegration(),
        ThreadingIntegration(),
    ],
)
Previous
Extended Configuration
Next
AIOHTTP
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
How to contribute   |  Edit this page   |  Create a docs issue   |  Get support
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.