@@ -236,82 +236,3 @@ def test_double_patch(self):
236
236
traces = self .tracer .writer .pop_traces ()
237
237
self .assertEqual (len (traces ), 1 )
238
238
self .assertEqual (len (traces [0 ]), 1 )
239
-
240
- @mark_asyncio
241
- def test_opentraced_client (self ):
242
- from tests .opentracer .utils import init_tracer
243
-
244
- ot_tracer = init_tracer ('my_svc' , self .tracer )
245
-
246
- with ot_tracer .start_active_span ('ot_outer_span' ):
247
- with aiobotocore_client ('ec2' , self .tracer ) as ec2 :
248
- yield from ec2 .describe_instances ()
249
-
250
- traces = self .tracer .writer .pop_traces ()
251
- print (traces )
252
- self .assertEqual (len (traces ), 1 )
253
- self .assertEqual (len (traces [0 ]), 2 )
254
- ot_span = traces [0 ][0 ]
255
- dd_span = traces [0 ][1 ]
256
-
257
- self .assertEqual (ot_span .resource , 'ot_outer_span' )
258
- self .assertEqual (ot_span .service , 'my_svc' )
259
-
260
- # confirm the parenting
261
- self .assertEqual (ot_span .parent_id , None )
262
- self .assertEqual (dd_span .parent_id , ot_span .span_id )
263
-
264
- self .assertEqual (dd_span .get_tag ('aws.agent' ), 'aiobotocore' )
265
- self .assertEqual (dd_span .get_tag ('aws.region' ), 'us-west-2' )
266
- self .assertEqual (dd_span .get_tag ('aws.operation' ), 'DescribeInstances' )
267
- self .assertEqual (dd_span .get_tag ('http.status_code' ), '200' )
268
- self .assertEqual (dd_span .get_tag ('retry_attempts' ), '0' )
269
- self .assertEqual (dd_span .service , 'aws.ec2' )
270
- self .assertEqual (dd_span .resource , 'ec2.describeinstances' )
271
- self .assertEqual (dd_span .name , 'ec2.command' )
272
-
273
- @mark_asyncio
274
- def test_opentraced_s3_client (self ):
275
- from tests .opentracer .utils import init_tracer
276
-
277
- ot_tracer = init_tracer ('my_svc' , self .tracer )
278
-
279
- with ot_tracer .start_active_span ('ot_outer_span' ):
280
- with aiobotocore_client ('s3' , self .tracer ) as s3 :
281
- yield from s3 .list_buckets ()
282
- with ot_tracer .start_active_span ('ot_inner_span1' ):
283
- yield from s3 .list_buckets ()
284
- with ot_tracer .start_active_span ('ot_inner_span2' ):
285
- pass
286
-
287
- traces = self .tracer .writer .pop_traces ()
288
- self .assertEqual (len (traces ), 1 )
289
- self .assertEqual (len (traces [0 ]), 5 )
290
- ot_outer_span = traces [0 ][0 ]
291
- dd_span = traces [0 ][1 ]
292
- ot_inner_span = traces [0 ][2 ]
293
- dd_span2 = traces [0 ][3 ]
294
- ot_inner_span2 = traces [0 ][4 ]
295
-
296
- self .assertEqual (ot_outer_span .resource , 'ot_outer_span' )
297
- self .assertEqual (ot_inner_span .resource , 'ot_inner_span1' )
298
- self .assertEqual (ot_inner_span2 .resource , 'ot_inner_span2' )
299
-
300
- # confirm the parenting
301
- self .assertEqual (ot_outer_span .parent_id , None )
302
- self .assertEqual (dd_span .parent_id , ot_outer_span .span_id )
303
- self .assertEqual (ot_inner_span .parent_id , ot_outer_span .span_id )
304
- self .assertEqual (dd_span2 .parent_id , ot_inner_span .span_id )
305
- self .assertEqual (ot_inner_span2 .parent_id , ot_outer_span .span_id )
306
-
307
- self .assertEqual (dd_span .get_tag ('aws.operation' ), 'ListBuckets' )
308
- self .assertEqual (dd_span .get_tag ('http.status_code' ), '200' )
309
- self .assertEqual (dd_span .service , 'aws.s3' )
310
- self .assertEqual (dd_span .resource , 's3.listbuckets' )
311
- self .assertEqual (dd_span .name , 's3.command' )
312
-
313
- self .assertEqual (dd_span2 .get_tag ('aws.operation' ), 'ListBuckets' )
314
- self .assertEqual (dd_span2 .get_tag ('http.status_code' ), '200' )
315
- self .assertEqual (dd_span2 .service , 'aws.s3' )
316
- self .assertEqual (dd_span2 .resource , 's3.listbuckets' )
317
- self .assertEqual (dd_span2 .name , 's3.command' )
0 commit comments