diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index 6e4604cf8c..dc50b7d7f4 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -10,7 +10,7 @@ from itertools import chain from sentry_sdk.attachments import Attachment -from sentry_sdk.consts import FALSE_VALUES, INSTRUMENTER +from sentry_sdk.consts import DEFAULT_MAX_BREADCRUMBS, FALSE_VALUES, INSTRUMENTER from sentry_sdk.profiler import Profile from sentry_sdk.session import Session from sentry_sdk.tracing_utils import ( @@ -847,7 +847,7 @@ def add_breadcrumb(self, crumb=None, hint=None, **kwargs): return before_breadcrumb = client.options.get("before_breadcrumb") - max_breadcrumbs = client.options.get("max_breadcrumbs") + max_breadcrumbs = client.options.get("max_breadcrumbs", DEFAULT_MAX_BREADCRUMBS) crumb = dict(crumb or ()) # type: Breadcrumb crumb.update(kwargs) diff --git a/tests/integrations/celery/test_celery.py b/tests/integrations/celery/test_celery.py index bf87463456..b6e4016626 100644 --- a/tests/integrations/celery/test_celery.py +++ b/tests/integrations/celery/test_celery.py @@ -246,6 +246,7 @@ def dummy_task(): # in the task and here is the same. assert scope._tags == {"foo": "bar"} + def test_simple_no_propagation(capture_events, init_celery): celery = init_celery(propagate_traces=False) events = capture_events()