Skip to content

feat: Use option to force-disable transaction events #14056

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

Merged
merged 2 commits into from
Jul 18, 2019
Merged
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
12 changes: 8 additions & 4 deletions src/sentry/utils/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from sentry_sdk.utils import Auth, capture_internal_exceptions
from sentry_sdk.utils import logger as sdk_logger

from sentry import options
from sentry.utils import metrics
from sentry.utils.rust import RustInfoIntegration

Expand Down Expand Up @@ -82,14 +83,17 @@ def configure_sdk():

assert sentry_sdk.Hub.main.client is None

options = settings.SENTRY_SDK_CONFIG
sdk_options = settings.SENTRY_SDK_CONFIG

internal_transport = InternalTransport()
upstream_transport = None
if options.get('dsn'):
upstream_transport = make_transport(get_options(options))
if sdk_options.get('dsn'):
upstream_transport = make_transport(get_options(sdk_options))

def capture_event(event):
if event.get('type') == 'transaction' and options.get('transaction-events.force-disable'):
return

# Make sure we log to upstream when available first
if upstream_transport is not None:
# TODO(mattrobenolt): Bring this back safely.
Expand All @@ -109,7 +113,7 @@ def capture_event(event):
RustInfoIntegration(),
],
transport=capture_event,
**options
**sdk_options
)


Expand Down