From 42f3b19a18dbc37adaea08afdfd65576b28a367d Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Tue, 7 May 2024 17:52:54 +0200 Subject: [PATCH] ref(celery): Handle retry count exceptions --- sentry_sdk/integrations/celery/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()