AIOHTTP

(New in version : 0.6.1 )

Import name: sentry_sdk.integrations.aiohttp.AioHttpIntegration

The AIOHTTP integration adds support for the AIOHTTP-Server Web Framework.

  1. Install sentry-sdk from PyPI:

     $ pip install --upgrade sentry-sdk==0.6.2
    
  2. Initialize the SDK before starting the server:

    import sentry_sdk
    from sentry_sdk.integrations.aiohttp import AioHttpIntegration
        
    sentry_sdk.init(
        dsn="___PUBLIC_DSN___",
        integrations=[AioHttpIntegration()]
    )
    
    from aiohttp import web
    
    async def hello(request):
        return web.Response(text="Hello, world")
    
        app = web.Application()
    app.add_routes([web.get('/', hello)])
    
    web.run_app(app)
    

Behavior

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

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

  • Request data is attached to all events: HTTP method, URL, headers, formdata, JSON payloads. Raw bodies and multipart file uploads are excluded. Personally identifiable information (such as user ids, usernames, cookies, authorization headers, ip addresses) is excluded unless send_default_pii is set to True.

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

In this guide