Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

237 integrate sentryio error reporting #245

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See [Wiki](https://github.com/sfbrigade/intentional-walk-server/wiki)
See the troubleshooting notes below.

2. Copy `example.env` to `.env` and edit the Docker environment variables as needed.
Sentry CSN will need to be retrieved from the Sentry console or another developer on this project.

3. Open a command-line shell, change into your repo directory, and execute this command:

Expand Down
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ DEBUG=1
SECRET_KEY=q!=ahgtraat*k4ytuniq)0892h7j5^2koqp55mh6p18$4344ks
TIME_ZONE=America/Los_Angeles
DEPLOY_ENV=development
SENTRY_DSN=https://example.ingest.us.sentry.io/4507858195447808
68 changes: 60 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ black = "^22.8.0"
flake8 = "^5.0.4"
autoflake = "^1.5.3"
djangorestframework = "^3.14.0"
sentry-sdk = {extras = ["django"], version = "^2.14.0"}

[tool.poetry.dev-dependencies]
freezegun = "^1.1.0"
Expand Down
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ colorama==0.4.4 ; python_version >= "3.8" and python_version < "4.0" and (sys_pl
coverage==5.5 ; python_version >= "3.8" and python_version < "4"
coveralls==1.11.1 ; python_version >= "3.8" and python_version < "4.0"
dj-database-url==0.5.0 ; python_version >= "3.8" and python_version < "4.0"
django-postgres-setfield @ git+https://github.com/benperlman/django-postgres-setfield.git@5969124d3da75a5ce1e5b84806f2fd2f8b7b532e ; python_version >= "3.8" and python_version < "4.0"
django-postgres-setfield @ git+https://github.com/benperlman/django-postgres-setfield.git@5969124d3da75a5ce1e5b84806f2fd2f8b7b532e ; python_vers
ion >= "3.8" and python_version < "4.0"
django==4.2.11 ; python_version >= "3.8" and python_version < "4.0"
djangorestframework==3.14.0 ; python_version >= "3.8" and python_version < "4.0"
docopt==0.6.2 ; python_version >= "3.8" and python_version < "4.0"
Expand All @@ -36,6 +37,7 @@ python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "4.0"
python-dotenv==0.11.0 ; python_version >= "3.8" and python_version < "4.0"
pytz==2021.3 ; python_version >= "3.8" and python_version < "4.0"
requests==2.26.0 ; python_version >= "3.8" and python_version < "4.0"
sentry-sdk[django]==2.14.0 ; python_version >= "3.8" and python_version < "4.0"
setuptools==65.3.0 ; python_version >= "3.8" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.8" and python_version < "4.0"
sqlparse==0.4.2 ; python_version >= "3.8" and python_version < "4.0"
Expand All @@ -44,6 +46,6 @@ toml==0.10.2 ; python_version >= "3.8" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
typing-extensions==4.3.0 ; python_version >= "3.8" and python_version < "3.11"
tzdata==2024.1 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "win32"
urllib3==1.26.7 ; python_version >= "3.8" and python_version < "4"
urllib3==1.26.20 ; python_version >= "3.8" and python_version < "4.0"
uuid==1.30 ; python_version >= "3.8" and python_version < "4.0"
whitenoise==5.3.0 ; python_version >= "3.8" and python_version < "4"
whitenoise==5.3.0 ; python_version >= "3.8" and python_version < "4"
14 changes: 14 additions & 0 deletions server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@
BASE_DIR = Path(__file__).resolve().parent.parent
PROJECT_ROOT = BASE_DIR

import sentry_sdk

sentry_sdk.init(
# SECURITY WARNING: keep the Sentry DSN secret!
dsn= os.getenv("SENTRY_DSN"),
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

Expand Down