(New in version 0.3.6 )

Import name: sentry_sdk.integrations.sanic.SanicIntegration

The Sanic integration adds support for the Sanic Web Framework.

  1. Install sentry-sdk from PyPI:

     $ pip install --upgrade sentry-sdk==0.4.3
  2. 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
    app = Sanic(__name__)


  • The Sanic integration will be installed for all of your apps.

  • A bit of data is attached to each event:

    • Personally identifiable information (such as user ids, usernames, cookies, authorization headers, ip addresses) is excluded unless send_default_pii is set to true.

    • Request data is attached to all events.

  • All exceptions leading to a Internal Server Error are reported.

  • Logging with any logger will create breadcrumbs when the Logging integration is enabled (done by default).