File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed
instrumentation/opentelemetry-instrumentation-threading
src/opentelemetry/instrumentation/threading Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -57,17 +57,25 @@ def _uninstrument(self, **kwargs):
57
57
58
58
@staticmethod
59
59
def _instrument_thread ():
60
- wrap_function_wrapper (threading .Thread , 'start' ,
61
- ThreadingInstrumentor .__wrap_threading_start )
62
- wrap_function_wrapper (threading .Thread , 'run' ,
63
- ThreadingInstrumentor .__wrap_threading_run )
60
+ wrap_function_wrapper (
61
+ threading .Thread ,
62
+ "start" ,
63
+ ThreadingInstrumentor .__wrap_threading_start ,
64
+ )
65
+ wrap_function_wrapper (
66
+ threading .Thread , "run" , ThreadingInstrumentor .__wrap_threading_run
67
+ )
64
68
65
69
@staticmethod
66
70
def _instrument_timer ():
67
- wrap_function_wrapper (threading .Timer , 'start' ,
68
- ThreadingInstrumentor .__wrap_threading_start )
69
- wrap_function_wrapper (threading .Timer , 'run' ,
70
- ThreadingInstrumentor .__wrap_threading_run )
71
+ wrap_function_wrapper (
72
+ threading .Timer ,
73
+ "start" ,
74
+ ThreadingInstrumentor .__wrap_threading_start ,
75
+ )
76
+ wrap_function_wrapper (
77
+ threading .Timer , "run" , ThreadingInstrumentor .__wrap_threading_run
78
+ )
71
79
72
80
@staticmethod
73
81
def _uninstrument_thread ():
Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ def test_trace_context_propagation_in_thread(self):
39
39
self .run_threading_test (threading .Thread (target = self .fake_func ))
40
40
41
41
def test_trace_context_propagation_in_timer (self ):
42
- self .run_threading_test (threading .Timer (
43
- interval = 1 , function = self .fake_func ))
42
+ self .run_threading_test (
43
+ threading .Timer (interval = 1 , function = self .fake_func )
44
+ )
44
45
45
46
def run_threading_test (self , thread : threading .Thread ):
46
47
with self .get_root_span () as span :
You can’t perform that action at this time.
0 commit comments