Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/platforms/python/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ sentry_sdk.init(
)
```

However, in async applications, you need to call `sentry_sdk.init()` inside an `async` function to ensure async code is instrumented properly. We recommend calling `sentry_sdk.init()` at the beginning of the first `async` function you call, as demonstrated in the example below.

```python
import asyncio
import sentry_sdk

async def main():
sentry_sdk.init(
... # same as above
)

asyncio.run(main())
```

## Verify

Add this intentional error to your application to test that everything is working right away.
Expand Down