File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 20
20
from celery import registry # pylint: disable=no-name-in-module
21
21
from celery .app .task import Task
22
22
23
- from opentelemetry .semconv .trace import SpanAttributes
23
+ from opentelemetry .semconv ._incubating .attributes import (
24
+ messaging_attributes as SpanAttributes ,
25
+ )
24
26
from opentelemetry .trace import Span
25
27
26
28
if TYPE_CHECKING :
@@ -92,7 +94,7 @@ def set_attributes_from_context(span, context):
92
94
93
95
if routing_key is not None :
94
96
span .set_attribute (
95
- SpanAttributes .MESSAGING_DESTINATION , routing_key
97
+ SpanAttributes .MESSAGING_DESTINATION_NAME , routing_key
96
98
)
97
99
98
100
value = str (value )
@@ -101,14 +103,13 @@ def set_attributes_from_context(span, context):
101
103
attribute_name = SpanAttributes .MESSAGING_MESSAGE_ID
102
104
103
105
elif key == "correlation_id" :
104
- attribute_name = SpanAttributes .MESSAGING_CONVERSATION_ID
106
+ attribute_name = SpanAttributes .MESSAGING_MESSAGE_CONVERSATION_ID
105
107
106
108
elif key == "routing_key" :
107
- attribute_name = SpanAttributes .MESSAGING_DESTINATION
109
+ attribute_name = SpanAttributes .MESSAGING_DESTINATION_NAME
108
110
109
111
# according to https://docs.celeryproject.org/en/stable/userguide/routing.html#exchange-types
110
112
elif key == "declare" :
111
- attribute_name = SpanAttributes .MESSAGING_DESTINATION_KIND
112
113
for declare in value :
113
114
if declare .exchange .type == "direct" :
114
115
value = "queue"
You can’t perform that action at this time.
0 commit comments