Skip to content

Commit

Permalink
Use FlaskIntegration and RqIntegration instead of SentryWsgiMiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
bellisk committed Aug 12, 2021
1 parent 4a7bebb commit 3115664
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ckanext/sentry/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import logging

import sentry_sdk
from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware
from sentry_sdk.integrations.logging import SentryHandler
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.rq import RqIntegration


from ckan import plugins
Expand Down Expand Up @@ -45,8 +46,10 @@ def make_error_log_middleware(self, app, config):
self._configure_logging(config)

log.debug('Adding Sentry middleware...')
sentry_sdk.init(dsn=config.get('sentry.dsn'))
sentry = SentryWsgiMiddleware(app)
sentry_sdk.init(
dsn=config.get('sentry.dsn'),
integrations=[FlaskIntegration(), RqIntegration()]
)
return app

def _configure_logging(self, config):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
blinker==1.4
sentry-sdk==1.3.1

0 comments on commit 3115664

Please sign in to comment.