File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed 
instrumentation/opentelemetry-instrumentation-aiohttp-server 
src/opentelemetry/instrumentation/aiohttp_server Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -113,9 +113,9 @@ async def hello(request):
113113    HTTP_SERVER_NAME ,
114114]
115115
116- tracer  =  trace . get_tracer ( __name__ ) 
117- meter  =  metrics . get_meter ( __name__ ,  __version__ ) 
118- _excluded_urls  =  get_excluded_urls ( "AIOHTTP_SERVER" ) 
116+ tracer  =  None 
117+ meter  =  None 
118+ _excluded_urls  =  None 
119119
120120
121121def  _parse_duration_attrs (req_attrs ):
@@ -315,10 +315,16 @@ class AioHttpServerInstrumentor(BaseInstrumentor):
315315    """ 
316316
317317    def  _instrument (self , ** kwargs ):
318-         # update the excluded urls value  at instrument time so we can test it  
319-         global  _excluded_urls    # pylint: disable=global-statement 
318+         # update global values  at instrument time so we can test them  
319+         global  _excluded_urls 
320320        _excluded_urls  =  get_excluded_urls ("AIOHTTP_SERVER" )
321321
322+         global  tracer   # pylint: disable=global-statement 
323+         tracer  =  trace .get_tracer (__name__ )
324+ 
325+         global  meter   # pylint: disable=global-statement 
326+         meter  =  metrics .get_meter (__name__ , __version__ )
327+ 
322328        self ._original_app  =  web .Application 
323329        setattr (web , "Application" , _InstrumentedApplication )
324330
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def fixture_tracer():
6969    reset_trace_globals ()
7070
7171
72- @pytest .fixture (name = "meter" , scope = "session " ) 
72+ @pytest .fixture (name = "meter" , scope = "function " ) 
7373def  fixture_meter ():
7474    test_base  =  TestBase ()
7575
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments