(New in version 0.3.6)
The Sanic integration adds support for the Sanic Web Framework. We support the following versions:
- Any version of the form
We do not support the latest version of Sanic. Versions between LTS releases have introduced breaking changes in the past without prior notice, so we cannot support them as they are too fast of a moving target.
A Python version of 3.6 or greater is also required.
$ pip install --upgrade 'sentry-sdk==0.16.0'
If you’re on Python 3.6, you also need the
$ pip install --upgrade aiocontextvars
To configure the SDK, initialize it with the integration before or after your app has been initialized:
import sentry_sdk from sentry_sdk.integrations.sanic import SanicIntegration from sanic import Sanic sentry_sdk.init( dsn="___PUBLIC_DSN___", integrations=[SanicIntegration()] ) app = Sanic(__name__)
The Sentry Python SDK will install the Sanic integration for all of your apps.
All exceptions leading to an Internal Server Error are reported.
Request data is attached to all events: HTTP method, URL, headers, form data, JSON payloads. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you set
Logging with any logger will create breadcrumbs when the Logging integration is enabled (done by default).