Skip to content

Commit

Permalink
chore: Configure sentry release and increase trace sample rate (#7341)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Oct 8, 2020
1 parent a6c2e2c commit b946ad6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from werkzeug.middleware.profiler import ProfilerMiddleware

from app.api import routes
from app.api import routes # noqa: Used for registering routes
from app.api.helpers.auth import AuthManager, is_token_blacklisted
from app.api.helpers.cache import cache
from app.api.helpers.errors import ErrorResponse
Expand Down Expand Up @@ -203,6 +203,7 @@ def create_app():
CeleryIntegration(),
SqlalchemyIntegration(),
],
release=app.config['SENTRY_RELEASE_NAME'],
traces_sample_rate=app.config['SENTRY_TRACES_SAMPLE_RATE'],
)

Expand Down
7 changes: 5 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
import os
import sys

from envparse import env

Expand Down Expand Up @@ -59,6 +59,10 @@ class Config:
SERVE_STATIC = env.bool('SERVE_STATIC', default=False)
DATABASE_QUERY_TIMEOUT = 0.1
SENTRY_DSN = env('SENTRY_DSN', default=None)
SENTRY_RELEASE_NAME = (
env('SENTRY_PROJECT_NAME', default='eventyay-server') + '@' + VERSION_NAME
)
SENTRY_TRACES_SAMPLE_RATE = env.float('SENTRY_TRACES_SAMPLE_RATE', default=0.1)
ENABLE_ELASTICSEARCH = env.bool('ENABLE_ELASTICSEARCH', default=False)
ELASTICSEARCH_HOST = env('ELASTICSEARCH_HOST', default='localhost:9200')
REDIS_URL = env('REDIS_URL', default='redis://localhost:6379/0')
Expand All @@ -72,7 +76,6 @@ class Config:
'API_PROPOGATE_UNCAUGHT_EXCEPTIONS', default=True
)
ETAG = True
SENTRY_TRACES_SAMPLE_RATE = env.float('SENTRY_TRACES_SAMPLE_RATE', default=0.01)
ATTACH_ORDER_PDF = env.bool('ATTACH_ORDER_PDF', default=True)

if not SQLALCHEMY_DATABASE_URI:
Expand Down

0 comments on commit b946ad6

Please sign in to comment.