Skip to content

Commit

Permalink
Merge pull request saleor#2295 from elwoodxblues/add-sentry
Browse files Browse the repository at this point in the history
Add Sentry
  • Loading branch information
Marcin Gębala authored Jun 19, 2018
2 parents 0a353f3 + 279d042 commit 3ff3457
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/integrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Integrations
integrations/googleanalytics
integrations/googleforretail
integrations/openexchangerates
integrations/sentry
14 changes: 14 additions & 0 deletions docs/integrations/sentry.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _sentry:

Sentry
======

Saleor provides integration with `Sentry <https://sentry.io/>`_ - a comprehensive error tracking and reporting tool.

To enable basic error reporting you have to export an environment variable:

``SENTRY_DSN``
Sentry Data Source Name


If you need to customize the service, please go to the `official Sentry's documentation for Django <https://docs.sentry.io/clients/python/integrations/django/>`_ for more details.
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pytest-django
pytest-vcr
pytest-mock
vcrpy
raven==6.9.0
requests>=1.2.0
social-auth-app-django>=2.0.0
text-unidecode
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ python-dateutil==2.6.1 # via botocore, elasticsearch-dsl, faker, freezegun
python3-openid==3.1.0 # via social-auth-core
pytz==2018.3 # via babel, celery, django
pyyaml==3.12 # via vcrpy
raven==6.9.0
redis==2.10.6 # via celery, django-redis
requests-oauthlib==0.8.0 # via social-auth-core
requests==2.18.4
Expand Down
13 changes: 12 additions & 1 deletion saleor/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from django.utils.translation import gettext_lazy as _
from django_prices.templatetags.prices_i18n import get_currency_fraction

from . import __version__


def get_list(text):
return [item.strip() for item in text.split(',')]
Expand Down Expand Up @@ -227,7 +229,8 @@ def get_bool_from_env(name, default_value):
'django_celery_results',
'impersonate',
'phonenumber_field',
'captcha']
'captcha',
'raven.contrib.django.raven_compat']

if DEBUG:
MIDDLEWARE.append(
Expand Down Expand Up @@ -494,3 +497,11 @@ def get_host():
# Set Google's reCaptcha keys
RECAPTCHA_PUBLIC_KEY = os.environ.get('RECAPTCHA_PUBLIC_KEY')
RECAPTCHA_PRIVATE_KEY = os.environ.get('RECAPTCHA_PRIVATE_KEY')


# Sentry
SENTRY_DSN = os.environ.get('SENTRY_DSN')
if SENTRY_DSN:
RAVEN_CONFIG = {
'dsn': SENTRY_DSN,
'release': __version__}

0 comments on commit 3ff3457

Please sign in to comment.