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 2020from celery import registry # pylint: disable=no-name-in-module
2121from celery .app .task import Task
2222
23- from opentelemetry .semconv .trace import SpanAttributes
23+ from opentelemetry .semconv ._incubating .attributes import (
24+ messaging_attributes as SpanAttributes ,
25+ )
2426from opentelemetry .trace import Span
2527
2628if TYPE_CHECKING :
@@ -92,7 +94,7 @@ def set_attributes_from_context(span, context):
9294
9395 if routing_key is not None :
9496 span .set_attribute (
95- SpanAttributes .MESSAGING_DESTINATION , routing_key
97+ SpanAttributes .MESSAGING_DESTINATION_NAME , routing_key
9698 )
9799
98100 value = str (value )
@@ -101,14 +103,13 @@ def set_attributes_from_context(span, context):
101103 attribute_name = SpanAttributes .MESSAGING_MESSAGE_ID
102104
103105 elif key == "correlation_id" :
104- attribute_name = SpanAttributes .MESSAGING_CONVERSATION_ID
106+ attribute_name = SpanAttributes .MESSAGING_MESSAGE_CONVERSATION_ID
105107
106108 elif key == "routing_key" :
107- attribute_name = SpanAttributes .MESSAGING_DESTINATION
109+ attribute_name = SpanAttributes .MESSAGING_DESTINATION_NAME
108110
109111 # according to https://docs.celeryproject.org/en/stable/userguide/routing.html#exchange-types
110112 elif key == "declare" :
111- attribute_name = SpanAttributes .MESSAGING_DESTINATION_KIND
112113 for declare in value :
113114 if declare .exchange .type == "direct" :
114115 value = "queue"
You can’t perform that action at this time.
0 commit comments