From 5a99aadca7d37845be812cd4d623c5a46b4c08ab Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Wed, 24 Apr 2024 12:45:48 +0200 Subject: [PATCH] feat(celery): Change inner span op to "queue.process" --- sentry_sdk/consts.py | 1 + sentry_sdk/integrations/celery/__init__.py | 2 +- tests/integrations/celery/test_celery.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/consts.py b/sentry_sdk/consts.py index 7db2220f68..c51cc9e226 100644 --- a/sentry_sdk/consts.py +++ b/sentry_sdk/consts.py @@ -245,6 +245,7 @@ class OP: MIDDLEWARE_STARLITE_SEND = "middleware.starlite.send" OPENAI_CHAT_COMPLETIONS_CREATE = "ai.chat_completions.create.openai" OPENAI_EMBEDDINGS_CREATE = "ai.embeddings.create.openai" + QUEUE_PROCESS = "queue.process" QUEUE_SUBMIT_ARQ = "queue.submit.arq" QUEUE_TASK_ARQ = "queue.task.arq" QUEUE_SUBMIT_CELERY = "queue.submit.celery" diff --git a/sentry_sdk/integrations/celery/__init__.py b/sentry_sdk/integrations/celery/__init__.py index ea217cf6a6..bd9be97aab 100644 --- a/sentry_sdk/integrations/celery/__init__.py +++ b/sentry_sdk/integrations/celery/__init__.py @@ -334,7 +334,7 @@ def _inner(*args, **kwargs): # type: (*Any, **Any) -> Any try: with sentry_sdk.start_span( - op=OP.QUEUE_TASK_CELERY, description=task.name + op=OP.QUEUE_PROCESS, description=task.name ) as span: _set_messaging_destination_name(task, span) return f(*args, **kwargs) diff --git a/tests/integrations/celery/test_celery.py b/tests/integrations/celery/test_celery.py index fdcf7027dd..9ac3d2aa7d 100644 --- a/tests/integrations/celery/test_celery.py +++ b/tests/integrations/celery/test_celery.py @@ -215,7 +215,7 @@ def dummy_task(x, y): >= { "trace_id": str(transaction.trace_id), "same_process_as_parent": True, - "op": "queue.task.celery", + "op": "queue.process", "description": "dummy_task", "data": ApproxDict(), }.items()