Skip to content
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
2 changes: 2 additions & 0 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,8 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
# This is used in case you want to report traces of your development set up to a project of your choice
SENTRY_SDK_CONFIG["dsn"] = SENTRY_DEV_DSN

SENTRY_SDK_THREADING_INTEGRATION = os.environ.get("SENTRY_SDK_DISABLE_THREADING") != "1"

# The sample rate to use for profiles. This is conditional on the usage of
# traces_sample_rate. So that means the true sample rate will be approximately
# traces_sample_rate * profiles_sample_rate
Expand Down
42 changes: 25 additions & 17 deletions src/sentry/utils/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,28 +523,36 @@ def flush(
from sentry_sdk.integrations.redis import RedisIntegration
from sentry_sdk.integrations.threading import ThreadingIntegration

integrations = [
DjangoAtomicIntegration(),
DjangoIntegration(
signals_spans=False,
cache_spans=True,
middleware_spans=False,
db_transaction_spans=True,
),
# This makes it so all levels of logging are recorded as breadcrumbs,
# but none are captured as events (that's handled by the `internal`
# logger defined in `server.py`, which ignores the levels set
# in the integration and goes straight to the underlying handler class).
LoggingIntegration(event_level=None, sentry_logs_level=logging.INFO),
RustInfoIntegration(),
RedisIntegration(),
]
disabled_integrations = []

if settings.SENTRY_SDK_THREADING_INTEGRATION:
integrations.append(ThreadingIntegration())
Comment thread
gi0baro marked this conversation as resolved.
else:
disabled_integrations.append(ThreadingIntegration())

sentry_sdk.init(
# set back the sentry4sentry_dsn popped above since we need a default dsn on the client
# for dynamic sampling context public_key population
dsn=dsns.sentry4sentry,
transport=MultiplexingTransport,
integrations=[
DjangoAtomicIntegration(),
DjangoIntegration(
signals_spans=False,
cache_spans=True,
middleware_spans=False,
db_transaction_spans=True,
),
# This makes it so all levels of logging are recorded as breadcrumbs,
# but none are captured as events (that's handled by the `internal`
# logger defined in `server.py`, which ignores the levels set
# in the integration and goes straight to the underlying handler class).
LoggingIntegration(event_level=None, sentry_logs_level=logging.INFO),
RustInfoIntegration(),
RedisIntegration(),
ThreadingIntegration(),
],
integrations=integrations,
disabled_integrations=disabled_integrations,
**sdk_options,
)

Expand Down
Loading