File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
instrumentation/opentelemetry-instrumentation-asyncio/tests Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -36,25 +36,20 @@ async def future_cancelled():
3636 asyncio .run (future_cancelled ())
3737 except asyncio .CancelledError as exc :
3838 self .assertEqual (isinstance (exc , asyncio .CancelledError ), True )
39- spans = self .memory_exporter . get_finished_spans ()
39+ spans = self .get_finished_spans ()
4040 self .assertEqual (len (spans ), 2 )
4141 self .assertEqual (spans [0 ].name , "root" )
4242 self .assertEqual (spans [1 ].name , "asyncio future" )
4343
44- metrics = (
45- self .memory_metrics_reader .get_metrics_data ()
46- .resource_metrics [0 ]
47- .scope_metrics [0 ]
48- .metrics
49- )
44+ metrics = self .get_sorted_metrics ()
5045 self .assertEqual (len (metrics ), 2 )
5146
52- self .assertEqual (metrics [0 ].name , "asyncio.process.duration " )
47+ self .assertEqual (metrics [0 ].name , "asyncio.process.created " )
5348 self .assertEqual (
5449 metrics [0 ].data .data_points [0 ].attributes ["state" ], "cancelled"
5550 )
5651
57- self .assertEqual (metrics [1 ].name , "asyncio.process.created " )
52+ self .assertEqual (metrics [1 ].name , "asyncio.process.duration " )
5853 self .assertEqual (
5954 metrics [1 ].data .data_points [0 ].attributes ["state" ], "cancelled"
6055 )
You can’t perform that action at this time.
0 commit comments