From 6c8446150e3aaeadc6c0ffb80a30ddd8dcf64c2a Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Fri, 10 May 2024 14:06:14 +0200 Subject: [PATCH] ref(celery): MESSAGING.SYSTEM SPANDATA constant ref #2951 --- sentry_sdk/consts.py | 5 +++++ sentry_sdk/integrations/celery/__init__.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index 453a785d69..bd7376e565 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -249,6 +249,11 @@ class SPANDATA: Number of retries/attempts to process a message. """ + MESSAGING_SYSTEM = "messaging.system" + """ + The messaging system's name, e.g. `kafka`, `aws_sqs` + """ + SERVER_ADDRESS = "server.address" """ Name of the database host. diff --git a/sentry_sdk/integrations/celery/__init__.py b/sentry_sdk/integrations/celery/__init__.py index 72c79cc400..521d37dc86 100644 --- a/sentry_sdk/integrations/celery/__init__.py +++ b/sentry_sdk/integrations/celery/__init__.py @@ -364,7 +364,8 @@ def _inner(*args, **kwargs): ) with capture_internal_exceptions(): span.set_data( - "messaging.system", task.app.connection().transport.driver_type + SPANDATA.MESSAGING_SYSTEM, + task.app.connection().transport.driver_type, ) return f(*args, **kwargs)