Skip to content

Commit

Permalink
feat(reporting): Refactored method signature to allow passing environ…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
b32147 committed Jul 18, 2024
1 parent 93a00a1 commit 91fb2b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dbmi_client/reporting.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import sentry_sdk
from furl import furl

from dbmi_client.settings import dbmi_settings


def sentry(sentry_dsn: str, release: str = None, sentry_trace_rate: float = 0.0, sentry_profile_rate: float = 0.0):
def sentry(sentry_dsn: str, release: str = None, environment: str = None, sentry_trace_rate: float = 0.0, sentry_profile_rate: float = 0.0):
"""
Initializes the Sentry client for the current application.
:param sentry_dsn: The DSN for the Sentry project
:type sentry_dsn: str
:param release: The current release of the application, defaults to None
:type release: str, optional
:param environment: The environment to which this applications is being deployed, defaults to None
:type environment: str, optional
:param sentry_trace_rate: The rate at which traces are sent, defaults to 0.0
:type sentry_trace_rate: float, optional
:param sentry_profile_rate: The rate at which requests are profiled, defaults to 0.0
Expand Down Expand Up @@ -39,8 +39,8 @@ def filter_transactions(event, hint):
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=sentry_profile_rate,
# Set the environment
environment=dbmi_settings.ENVIRONMENT,
# Set the environment if passed
environment=environment,
# Set release, if passed
release=release,
)

0 comments on commit 91fb2b9

Please sign in to comment.