Skip to content

Commit

Permalink
Merge pull request #3 from Savage-Aim/sentry
Browse files Browse the repository at this point in the history
Sentry (and maintenance handling)
  • Loading branch information
freyamade authored Jan 24, 2022
2 parents 52ab40f + de1bcfd commit 011baae
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file deployment/Dockerfile --tag docker.pkg.github.com/savage-aim/app/frontend:latest -t docker.pkg.github.com/savage-aim/app/frontend:$(echo "$GITHUB_REF" | sed 's/refs\/tags\///')
- name: Build maintenance image
run: docker build . --file deployment/Dockerfile --build_arg VUE_APP_MAINTENANCE="1" --tag docker.pkg.github.com/savage-aim/app/frontend:maint
- name: Login to GitHub Docker Registry
run: docker login docker.pkg.github.com -u freyamade -p ${{ secrets.GITHUB_TOKEN }}
- name: Push the Docker image
Expand Down
17 changes: 17 additions & 0 deletions backend/backend/settings_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import sentry_sdk
from os import environ
from pathlib import Path
from sentry_sdk.integrations.django import DjangoIntegration

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand Down Expand Up @@ -130,3 +132,18 @@
'level': 'WARNING',
},
}

# Sentry for errors as well
sentry_sdk.init(
dsn=environ['SENTRY_DSN'],
integrations=[DjangoIntegration()],

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces_sample_rate=1.0,

# If you wish to associate users to errors (assuming you are using
# django.contrib.auth) you may enable sending PII data.
send_default_pii=True
)
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pytz==2021.3
redis==4.1.0
requests==2.26.0
requests-oauthlib==1.3.0
sentry-sdk==1.5.3
six==1.16.0
soupsieve==2.3.1
sqlparse==0.4.2
Expand Down

0 comments on commit 011baae

Please sign in to comment.