@@ -80,10 +80,10 @@ void AssertIntTagGreaterThanZero(Activity activity, string name)
8080 [ InlineData ( true , false ) ]
8181 [ InlineData ( false , true ) ]
8282 [ InlineData ( false , false ) ]
83- public async Task TestPublisherAndConsumerActivityTags ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
83+ public async Task TestPublisherAndConsumerActivityTags ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
8484 {
8585 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
86- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
86+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
8787 var _activities = new List < Activity > ( ) ;
8888 using ActivityListener activityListener = StartActivityListener ( _activities ) ;
8989 await Task . Delay ( 500 ) ;
@@ -109,18 +109,18 @@ public async Task TestPublisherAndConsumerActivityTags(bool useRoutingKeyAsOpera
109109
110110 await _channel . BasicCancelAsync ( consumerTag ) ;
111111 await Task . Delay ( 500 ) ;
112- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queueName , _activities , true ) ;
112+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queueName , _activities , true ) ;
113113 }
114114
115115 [ Theory ]
116116 [ InlineData ( true , true ) ]
117117 [ InlineData ( true , false ) ]
118118 [ InlineData ( false , true ) ]
119119 [ InlineData ( false , false ) ]
120- public async Task TestPublisherWithCachedStringsAndConsumerActivityTags ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
120+ public async Task TestPublisherWithCachedStringsAndConsumerActivityTags ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
121121 {
122122 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
123- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
123+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
124124 var _activities = new List < Activity > ( ) ;
125125 using ActivityListener activityListener = StartActivityListener ( _activities ) ;
126126 await Task . Delay ( 500 ) ;
@@ -148,18 +148,18 @@ public async Task TestPublisherWithCachedStringsAndConsumerActivityTags(bool use
148148
149149 await _channel . BasicCancelAsync ( consumerTag ) ;
150150 await Task . Delay ( 500 ) ;
151- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queueName , _activities , true ) ;
151+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queueName , _activities , true ) ;
152152 }
153153
154154 [ Theory ]
155155 [ InlineData ( true , true ) ]
156156 [ InlineData ( true , false ) ]
157157 [ InlineData ( false , true ) ]
158158 [ InlineData ( false , false ) ]
159- public async Task TestPublisherWithPublicationAddressAndConsumerActivityTags ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
159+ public async Task TestPublisherWithPublicationAddressAndConsumerActivityTags ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
160160 {
161161 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
162- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
162+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
163163 var _activities = new List < Activity > ( ) ;
164164 using ActivityListener activityListener = StartActivityListener ( _activities ) ;
165165 await Task . Delay ( 500 ) ;
@@ -186,18 +186,18 @@ public async Task TestPublisherWithPublicationAddressAndConsumerActivityTags(boo
186186
187187 await _channel . BasicCancelAsync ( consumerTag ) ;
188188 await Task . Delay ( 500 ) ;
189- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queueName , _activities , true ) ;
189+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queueName , _activities , true ) ;
190190 }
191191
192192 [ Theory ]
193193 [ InlineData ( true , true ) ]
194194 [ InlineData ( true , false ) ]
195195 [ InlineData ( false , true ) ]
196196 [ InlineData ( false , false ) ]
197- public async Task TestPublisherAndConsumerActivityTagsAsync ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
197+ public async Task TestPublisherAndConsumerActivityTagsAsync ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
198198 {
199199 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
200- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
200+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
201201 var activities = new List < Activity > ( ) ;
202202 using ActivityListener activityListener = StartActivityListener ( activities ) ;
203203 await Task . Delay ( 500 ) ;
@@ -224,18 +224,18 @@ public async Task TestPublisherAndConsumerActivityTagsAsync(bool useRoutingKeyAs
224224
225225 await _channel . BasicCancelAsync ( consumerTag ) ;
226226 await Task . Delay ( 500 ) ;
227- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queueName , activities , true ) ;
227+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queueName , activities , true ) ;
228228 }
229229
230230 [ Theory ]
231231 [ InlineData ( true , true ) ]
232232 [ InlineData ( true , false ) ]
233233 [ InlineData ( false , true ) ]
234234 [ InlineData ( false , false ) ]
235- public async Task TestPublisherWithCachedStringsAndConsumerActivityTagsAsync ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
235+ public async Task TestPublisherWithCachedStringsAndConsumerActivityTagsAsync ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
236236 {
237237 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
238- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
238+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
239239 var activities = new List < Activity > ( ) ;
240240 using ActivityListener activityListener = StartActivityListener ( activities ) ;
241241 await Task . Delay ( 500 ) ;
@@ -264,18 +264,18 @@ public async Task TestPublisherWithCachedStringsAndConsumerActivityTagsAsync(boo
264264
265265 await _channel . BasicCancelAsync ( consumerTag ) ;
266266 await Task . Delay ( 500 ) ;
267- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queueName , activities , true ) ;
267+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queueName , activities , true ) ;
268268 }
269269
270270 [ Theory ]
271271 [ InlineData ( true , true ) ]
272272 [ InlineData ( true , false ) ]
273273 [ InlineData ( false , true ) ]
274274 [ InlineData ( false , false ) ]
275- public async Task TestPublisherWithPublicationAddressAndConsumerActivityTagsAsync ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
275+ public async Task TestPublisherWithPublicationAddressAndConsumerActivityTagsAsync ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
276276 {
277277 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
278- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
278+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
279279 var activities = new List < Activity > ( ) ;
280280 using ActivityListener activityListener = StartActivityListener ( activities ) ;
281281 await Task . Delay ( 500 ) ;
@@ -303,18 +303,18 @@ public async Task TestPublisherWithPublicationAddressAndConsumerActivityTagsAsyn
303303
304304 await _channel . BasicCancelAsync ( consumerTag ) ;
305305 await Task . Delay ( 500 ) ;
306- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queueName , activities , true ) ;
306+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queueName , activities , true ) ;
307307 }
308308
309309 [ Theory ]
310310 [ InlineData ( true , true ) ]
311311 [ InlineData ( true , false ) ]
312312 [ InlineData ( false , true ) ]
313313 [ InlineData ( false , false ) ]
314- public async Task TestPublisherAndBasicGetActivityTags ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
314+ public async Task TestPublisherAndBasicGetActivityTags ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
315315 {
316316 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
317- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
317+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
318318 var activities = new List < Activity > ( ) ;
319319 using ActivityListener activityListener = StartActivityListener ( activities ) ;
320320 await Task . Delay ( 500 ) ;
@@ -332,7 +332,7 @@ public async Task TestPublisherAndBasicGetActivityTags(bool useRoutingKeyAsOpera
332332 ok = await _channel . QueueDeclarePassiveAsync ( queue ) ;
333333 Assert . Equal ( 0u , ok . MessageCount ) ;
334334 await Task . Delay ( 500 ) ;
335- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queue , activities , false ) ;
335+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queue , activities , false ) ;
336336 }
337337 finally
338338 {
@@ -345,10 +345,10 @@ public async Task TestPublisherAndBasicGetActivityTags(bool useRoutingKeyAsOpera
345345 [ InlineData ( true , false ) ]
346346 [ InlineData ( false , true ) ]
347347 [ InlineData ( false , false ) ]
348- public async Task TestPublisherWithCachedStringsAndBasicGetActivityTags ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
348+ public async Task TestPublisherWithCachedStringsAndBasicGetActivityTags ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
349349 {
350350 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
351- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
351+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
352352 var activities = new List < Activity > ( ) ;
353353 using ActivityListener activityListener = StartActivityListener ( activities ) ;
354354 await Task . Delay ( 500 ) ;
@@ -368,7 +368,7 @@ public async Task TestPublisherWithCachedStringsAndBasicGetActivityTags(bool use
368368 ok = await _channel . QueueDeclarePassiveAsync ( queue ) ;
369369 Assert . Equal ( 0u , ok . MessageCount ) ;
370370 await Task . Delay ( 500 ) ;
371- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queue , activities , false ) ;
371+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queue , activities , false ) ;
372372 }
373373 finally
374374 {
@@ -381,10 +381,10 @@ public async Task TestPublisherWithCachedStringsAndBasicGetActivityTags(bool use
381381 [ InlineData ( true , false ) ]
382382 [ InlineData ( false , true ) ]
383383 [ InlineData ( false , false ) ]
384- public async Task TestPublisherWithPublicationAddressAndBasicGetActivityTags ( bool useRoutingKeyAsOperationName , bool useParentChildLinking )
384+ public async Task TestPublisherWithPublicationAddressAndBasicGetActivityTags ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent )
385385 {
386386 RabbitMQActivitySource . UseRoutingKeyAsOperationName = useRoutingKeyAsOperationName ;
387- RabbitMQActivitySource . TracingOptions . LinkType = useParentChildLinking ? TracingLinkType . AlwaysParentChildAndLink : TracingLinkType . AlwaysLink ;
387+ RabbitMQActivitySource . TracingOptions . UsePublisherAsParent = usePublisherAsParent ;
388388 var activities = new List < Activity > ( ) ;
389389 using ActivityListener activityListener = StartActivityListener ( activities ) ;
390390 await Task . Delay ( 500 ) ;
@@ -404,7 +404,7 @@ public async Task TestPublisherWithPublicationAddressAndBasicGetActivityTags(boo
404404 ok = await _channel . QueueDeclarePassiveAsync ( queue ) ;
405405 Assert . Equal ( 0u , ok . MessageCount ) ;
406406 await Task . Delay ( 500 ) ;
407- AssertActivityData ( useRoutingKeyAsOperationName , useParentChildLinking , queue , activities , false ) ;
407+ AssertActivityData ( useRoutingKeyAsOperationName , usePublisherAsParent , queue , activities , false ) ;
408408 }
409409 finally
410410 {
@@ -426,7 +426,7 @@ private static ActivityListener StartActivityListener(List<Activity> activities)
426426 return activityListener ;
427427 }
428428
429- private void AssertActivityData ( bool useRoutingKeyAsOperationName , bool useParentChildLinking , string queueName ,
429+ private void AssertActivityData ( bool useRoutingKeyAsOperationName , bool usePublisherAsParent , string queueName ,
430430 List < Activity > activityList , bool isDeliver = false )
431431 {
432432 string childName = isDeliver ? "deliver" : "fetch" ;
@@ -453,7 +453,7 @@ private void AssertActivityData(bool useRoutingKeyAsOperationName, bool useParen
453453 Assert . Equal ( ActivityKind . Producer , sendActivity . Kind ) ;
454454 Assert . Equal ( ActivityKind . Consumer , receiveActivity . Kind ) ;
455455 Assert . Equal ( sendActivity . TraceId , receiveActivity . Links . Single ( ) . Context . TraceId ) ;
456- if ( useParentChildLinking )
456+ if ( usePublisherAsParent )
457457 {
458458 Assert . Equal ( sendActivity . Id , receiveActivity . ParentId ) ;
459459 Assert . Equal ( sendActivity . TraceId , receiveActivity . TraceId ) ;
0 commit comments