diff --git a/docs/platforms/python/integrations/asyncio/index.mdx b/docs/platforms/python/integrations/asyncio/index.mdx index 7abdcbac36366..411b43663bdc8 100644 --- a/docs/platforms/python/integrations/asyncio/index.mdx +++ b/docs/platforms/python/integrations/asyncio/index.mdx @@ -16,6 +16,10 @@ uv add "sentry-sdk" ## Configure +`AsyncioIntegration` works by instrumenting the current event loop, which is why it needs to be enabled when there's an event loop running. + +### Enable `Asynciointegration` At `Init` Time + Add `AsyncioIntegration()` to your list of `integrations`, enable tracing and be sure to call `sentry_sdk.init()` **at the beginning of the first `async` function you call**, as shown in the example below. + The SDK needs the event loop to be running when instrumenting asyncio. Make sure to call `sentry_sdk.init()` inside of an `async` function. + + + You can initialize the SDK without `AsyncioIntegration` and then run `sentry_sdk.integrations.asyncio.enable_asyncio_integration()` once there is an event loop running. See [this section](#enable-asynciointegration-after-init) for an example. + + + ## Supported Versions - Python: 3.7+