---
title: "Default Integrations"
description: "Learn about default integrations, what they do, and how they hook into the standard library or the interpreter itself."
url: https://docs.sentry.io/platforms/python/integrations/default-integrations/
---

# Default Integrations | Sentry for Python

System integrations are integrations enabled by default that integrate into the standard library or the interpreter itself. Sentry documents them so you can see what they do and that they can be disabled if they cause issues. To disable all system integrations, set `default_integrations=False` when calling `init()`.

## [Atexit](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#atexit)

*Import name: `sentry_sdk.integrations.atexit.AtexitIntegration`*

This integrates with the interpreter's `atexit` system to automatically flush events from the background queue on interpreter shutdown. Typically, one does not need to disable this. Even if the functionality is not wanted, it's easier to disable it by setting the `shutdown_timeout` to `0` in the options passed to `init()`.

## [Excepthook](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#excepthook)

*Import name: `sentry_sdk.integrations.excepthook.ExcepthookIntegration`*

This integration registers with the interpreter's except hook system. Through this, any exception that is unhandled will be reported to Sentry automatically. Note that exceptions raised in interactive interpreter sessions will not be reported.

### [Options](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#options)

You can pass the following keyword arguments to `ExcepthookIntegration()`:

* `always_run`:

  ```bash
  $ python
  >>> import sentry_sdk
  >>> from sentry_sdk.integrations.excepthook import ExcepthookIntegration
  >>> sentry_sdk.init(..., integrations=[ExcepthookIntegration(always_run=True)])
  >>> raise Exception("I will become an error")
  ```

  By default, the SDK does not capture errors occurring in the REPL (`always_run=False`).

## [Deduplication](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#deduplication)

*Import name: `sentry_sdk.integrations.dedupe.DedupeIntegration`*

This integration deduplicates certain events. The Sentry Python SDK enables it by default, and it should not be disabled except in rare circumstances. Disabling this integration, for instance, will cause duplicate error logging in the Flask framework.

## [Stdlib](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#stdlib)

*Import name: `sentry_sdk.integrations.stdlib.StdlibIntegration`*

The stdlib integration instruments certain modules in the standard library to emit breadcrumbs. The Sentry Python SDK enables this by default, and it rarely makes sense to disable.

* Any outgoing HTTP request done with `httplib` will result in a [breadcrumb](https://docs.sentry.io/platforms/python/enriching-events/breadcrumbs.md) being logged. `urllib3` and `requests` use `httplib` under the hood, so HTTP requests from those packages should be covered as well.

* Subprocesses spawned with the `subprocess` module will result in a [breadcrumb](https://docs.sentry.io/platforms/python/enriching-events/breadcrumbs.md) being logged.

## [Modules](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#modules)

*Import name: `sentry_sdk.integrations.modules.ModulesIntegration`*

Sends a list of installed Python packages along with each event.

## [Argv](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#argv)

*Import name: `sentry_sdk.integrations.argv.ArgvIntegration`*

Adds `sys.argv` as an `extra` attribute to each event.

## [Logging](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#logging)

*Import name: `sentry_sdk.integrations.logging.LoggingIntegration`*

See [*Logging*](https://docs.sentry.io/platforms/python/integrations/logging.md)

## [Threading](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#threading)

*Import name: `sentry_sdk.integrations.threading.ThreadingIntegration`*

Reports crashing threads.

This integration also accepts an option `propagate_scope`, which influences the way data is transferred between threads. If set to `True` (default), the current scope will be shared between threads and scope data (such as tags) will be transferred from the parent thread to the child thread.

Context data is automatically propagated in `concurrent.futures` thread pools beginning with version 2.41.0, when `propagate_scope` is `True`.

Next are two code samples that demonstrate what boilerplate you would have to write without `propagate_scope`. This boilerplate is necessary if you want to propagate context data into a thread pool before version 2.41.0, for example.

### [Manual propagation](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#manual-propagation)

```python
import threading

import sentry_sdk

sentry_sdk.init(...)

sentry_sdk.set_tag("mydata", 42)

def run(thread_scope):
    thread_scope.capture_message("hi")  # event will have `mydata` tag attached

# We take all context data (the tags map and even the entire client
# configuration), and pass it as explicit variable
# into the thread.
with isolation_scope() as thread_scope:
    tr = threading.Thread(target=run, args=[thread_scope])
    tr.start()
    tr.join()
```

### [Automatic propagation](https://docs.sentry.io/platforms/python/integrations/default-integrations.md#automatic-propagation)

```python
import threading

import sentry_sdk
from sentry_sdk.integrations.threading import ThreadingIntegration

sentry_sdk.init(
    ...,
    integrations=[
        ThreadingIntegration(propagate_scope=True),
    ],
)

sentry_sdk.set_tag("mydata", 42)

def run():
    sentry_sdk.capture_message("hi")  # event will have `mydata` tag attached

# The threading integration hooks into the stdlib to automatically pass
# existing context data when a `Thread` is instantiated.
tr = threading.Thread(target=run)
tr.start()
tr.join()
```
