Skip to content

Commit

Permalink
Configure Sentry for profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
mihow committed Feb 14, 2024
1 parent d6ecf40 commit e6f04e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .envs/.production/.django-example
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ DJANGO_AWS_STORAGE_BUCKET_NAME=
# Sentry
SENTRY_DSN=
# DJANGO_SENTRY_LOG_LEVEL=1
SENTRY_ENVIRONMENT=development
SENTRY_TRACES_SAMPLE_RATE=1.0 # Set to max for profiling
SENTRY_PROFILES_SAMPLE_RATE=1.0 # Set to max for profiling

DJANGO_ACCOUNT_ALLOW_REGISTRATION=True
# django-allauth
Expand Down
5 changes: 3 additions & 2 deletions config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=integrations,
environment=env("SENTRY_ENVIRONMENT", default="production"),
traces_sample_rate=env.float("SENTRY_TRACES_SAMPLE_RATE", default=1.0),
environment=env("SENTRY_ENVIRONMENT", default="unspecified"),
traces_sample_rate=env.float("SENTRY_TRACES_SAMPLE_RATE", default=0.0),
profiles_sample_rate=env.float("SENTRY_PROFILES_SAMPLE_RATE", default=0.0),
)

# django-rest-framework
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ boto3==1.28
rich==13.5
pydantic<2.0 # Less than 2.0 because of django pydantic field
django-pydantic-field==0.2.11
sentry-sdk==1.40.0 # https://github.com/getsentry/sentry-python
sentry-sdk==1.40.4 # https://github.com/getsentry/sentry-python

# Django
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit e6f04e4

Please sign in to comment.