File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
projects/RabbitMQ.Client/client/impl Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -117,22 +117,25 @@ internal static Activity Deliver(BasicDeliverEventArgs deliverEventArgs)
117
117
return null ;
118
118
}
119
119
120
- // TODO
121
- string routingKey = Encoding . UTF8 . GetString ( deliverEventArgs . RoutingKey . ToArray ( ) ) ;
122
- string exchange = Encoding . UTF8 . GetString ( deliverEventArgs . Exchange . ToArray ( ) ) ;
123
-
124
120
// Extract the PropagationContext of the upstream parent from the message headers.
125
121
DistributedContextPropagator . Current . ExtractTraceIdAndState ( deliverEventArgs . BasicProperties . Headers ,
126
122
ExtractTraceIdAndState , out string traceparent , out string traceState ) ;
127
123
128
124
ActivityContext . TryParse ( traceparent , traceState , out ActivityContext parentContext ) ;
129
125
126
+ string routingKey = UseRoutingKeyAsOperationName ? Encoding . UTF8 . GetString ( deliverEventArgs . RoutingKey . Span ) : null ;
130
127
Activity activity = s_subscriberSource . StartLinkedRabbitMQActivity (
131
128
UseRoutingKeyAsOperationName ? $ "{ routingKey } deliver" : "deliver" ,
132
129
ActivityKind . Consumer , parentContext ) ;
133
130
134
131
if ( activity != null && activity . IsAllDataRequested )
135
132
{
133
+ string exchange = Encoding . UTF8 . GetString ( deliverEventArgs . Exchange . Span ) ;
134
+ if ( routingKey == null )
135
+ {
136
+ routingKey = Encoding . UTF8 . GetString ( deliverEventArgs . RoutingKey . Span ) ;
137
+ }
138
+
136
139
PopulateMessagingTags ( "deliver" ,
137
140
routingKey ,
138
141
exchange ,
You can’t perform that action at this time.
0 commit comments