Skip to content

Commit

Permalink
ref(celery): Message ID SPANDATA constant
Browse files Browse the repository at this point in the history
ref #2974
  • Loading branch information
szokeasaurusrex committed May 10, 2024
1 parent 118607e commit 9af5324
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions sentry_sdk/consts.py
Expand Up @@ -239,6 +239,11 @@ class SPANDATA:
e.g. the queue name or topic.
"""

MESSAGING_MESSAGE_ID = "messaging.message.id"
"""
The message's identifier.
"""

MESSAGING_MESSAGE_RETRY_COUNT = "messaging.message.retry.count"
"""
Number of retries/attempts to process a message.
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/celery/__init__.py
Expand Up @@ -357,7 +357,7 @@ def _inner(*args, **kwargs):
) as span:
_set_messaging_destination_name(task, span)
with capture_internal_exceptions():
span.set_data("messaging.message.id", task.request.id)
span.set_data(SPANDATA.MESSAGING_MESSAGE_ID, task.request.id)
with capture_internal_exceptions():
span.set_data(
SPANDATA.MESSAGING_MESSAGE_RETRY_COUNT, task.request.retries
Expand Down

0 comments on commit 9af5324

Please sign in to comment.