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)
117117 return null ;
118118 }
119119
120- // TODO
121- string routingKey = Encoding . UTF8 . GetString ( deliverEventArgs . RoutingKey . ToArray ( ) ) ;
122- string exchange = Encoding . UTF8 . GetString ( deliverEventArgs . Exchange . ToArray ( ) ) ;
123-
124120 // Extract the PropagationContext of the upstream parent from the message headers.
125121 DistributedContextPropagator . Current . ExtractTraceIdAndState ( deliverEventArgs . BasicProperties . Headers ,
126122 ExtractTraceIdAndState , out string traceparent , out string traceState ) ;
127123
128124 ActivityContext . TryParse ( traceparent , traceState , out ActivityContext parentContext ) ;
129125
126+ string routingKey = UseRoutingKeyAsOperationName ? Encoding . UTF8 . GetString ( deliverEventArgs . RoutingKey . Span ) : null ;
130127 Activity activity = s_subscriberSource . StartLinkedRabbitMQActivity (
131128 UseRoutingKeyAsOperationName ? $ "{ routingKey } deliver" : "deliver" ,
132129 ActivityKind . Consumer , parentContext ) ;
133130
134131 if ( activity != null && activity . IsAllDataRequested )
135132 {
133+ string exchange = Encoding . UTF8 . GetString ( deliverEventArgs . Exchange . Span ) ;
134+ if ( routingKey == null )
135+ {
136+ routingKey = Encoding . UTF8 . GetString ( deliverEventArgs . RoutingKey . Span ) ;
137+ }
138+
136139 PopulateMessagingTags ( "deliver" ,
137140 routingKey ,
138141 exchange ,
You can’t perform that action at this time.
0 commit comments