diff --git a/sentry_sdk/integrations/celery/__init__.py b/sentry_sdk/integrations/celery/__init__.py index b662c7044c..445f370c30 100644 --- a/sentry_sdk/integrations/celery/__init__.py +++ b/sentry_sdk/integrations/celery/__init__.py @@ -337,7 +337,8 @@ def _inner(*args, **kwargs): op=OP.QUEUE_PROCESS, description=task.name ) as span: _set_messaging_destination_name(task, span) - span.set_data("messaging.message.retry.count", task.request.retries) + with capture_internal_exceptions(): + span.set_data("messaging.message.retry.count", task.request.retries) return f(*args, **kwargs) except Exception: exc_info = sys.exc_info()