From 356ad6c9703ec4274fe964cf0cfb568712d9dfe8 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Tue, 13 Oct 2020 09:50:43 +0200 Subject: [PATCH] feat: Auto enable integrations=true (#845) * feat: Auto enable integrations=true * fix: Formatting * ref: Remove experiments flag * fix: Formatting Co-authored-by: sentry-bot --- sentry_sdk/client.py | 6 +++--- sentry_sdk/consts.py | 1 + tests/integrations/flask/test_flask.py | 2 +- tests/test_basics.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sentry_sdk/client.py b/sentry_sdk/client.py index 8705a119d0..168198adb9 100644 --- a/sentry_sdk/client.py +++ b/sentry_sdk/client.py @@ -128,9 +128,9 @@ def _send_sessions(sessions): self.integrations = setup_integrations( self.options["integrations"], with_defaults=self.options["default_integrations"], - with_auto_enabling_integrations=self.options["_experiments"].get( - "auto_enabling_integrations", False - ), + with_auto_enabling_integrations=self.options[ + "auto_enabling_integrations" + ], ) finally: _client_init_debug.set(old_debug) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index e76666637e..9604418a65 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -64,6 +64,7 @@ def __init__( ca_certs=None, # type: Optional[str] propagate_traces=True, # type: bool traces_sample_rate=0.0, # type: float + auto_enabling_integrations=True, # type: bool _experiments={}, # type: Experiments # noqa: B006 ): # type: (...) -> None diff --git a/tests/integrations/flask/test_flask.py b/tests/integrations/flask/test_flask.py index 4839892221..4d49015811 100644 --- a/tests/integrations/flask/test_flask.py +++ b/tests/integrations/flask/test_flask.py @@ -45,7 +45,7 @@ def hi(): @pytest.fixture(params=("auto", "manual")) def integration_enabled_params(request): if request.param == "auto": - return {"_experiments": {"auto_enabling_integrations": True}} + return {"auto_enabling_integrations": True} elif request.param == "manual": return {"integrations": [flask_sentry.FlaskIntegration()]} else: diff --git a/tests/test_basics.py b/tests/test_basics.py index f5b25514c7..d7cc2d58cb 100644 --- a/tests/test_basics.py +++ b/tests/test_basics.py @@ -43,7 +43,7 @@ def error_processor(event, exc_info): def test_auto_enabling_integrations_catches_import_error(sentry_init, caplog): caplog.set_level(logging.DEBUG) - sentry_init(_experiments={"auto_enabling_integrations": True}, debug=True) + sentry_init(auto_enabling_integrations=True, debug=True) for import_string in _AUTO_ENABLING_INTEGRATIONS: assert any(