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

chore: Configure sentry release and increase trace sample rate #7341

Merged
Merged
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
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