AG
в
__init__.py
делаюimport sentry_sdk
SENTRY_URI = "..."
sentry_sdk.init(SENTRY_URI)
я так сделал:
from raven import Client as SentryClient
from raven_aiohttp import AioHttpTransport
sentry_client = SentryClient(dsn=conf.SENTRY_SDN, transport=AioHttpTransport)
class SentryMiddleware(BaseMiddleware):
async def on_pre_process_error(self, update, error, data: dict):
sentry_client.captureException(error=error, data=data, message=update)