16
16
from pika .adapters import BaseConnection
17
17
from pika .channel import Channel
18
18
19
- from opentelemetry .instrumentation .pika import PikaInstrumentation
19
+ from opentelemetry .instrumentation .pika import PikaInstrumentor
20
20
from opentelemetry .trace import Tracer
21
21
22
22
@@ -38,7 +38,7 @@ def test_instrument_api(
38
38
uninstrument_channel_functions : mock .MagicMock ,
39
39
instrument_channel : mock .MagicMock ,
40
40
) -> None :
41
- instrumentation = PikaInstrumentation ()
41
+ instrumentation = PikaInstrumentor ()
42
42
instrumentation .instrument (channel = self .channel )
43
43
instrument_channel .assert_called_once_with (
44
44
self .channel , tracer_provider = None
@@ -64,7 +64,7 @@ def test_instrument(
64
64
instrument_consumers : mock .MagicMock ,
65
65
instrument_channel_functions : mock .MagicMock ,
66
66
):
67
- PikaInstrumentation .instrument_channel (channel = self .channel )
67
+ PikaInstrumentor .instrument_channel (channel = self .channel )
68
68
assert hasattr (
69
69
self .channel , "__opentelemetry_tracer"
70
70
), "Tracer not set for the channel!"
@@ -80,7 +80,7 @@ def test_instrument_consumers(
80
80
mock .call (value , tracer , key )
81
81
for key , value in self .channel ._impl ._consumers .items ()
82
82
]
83
- PikaInstrumentation ._instrument_consumers (
83
+ PikaInstrumentor ._instrument_consumers (
84
84
self .channel ._impl ._consumers , tracer
85
85
)
86
86
decorate_callback .assert_has_calls (
@@ -99,7 +99,7 @@ def test_instrument_basic_publish(
99
99
) -> None :
100
100
tracer = mock .MagicMock (spec = Tracer )
101
101
original_function = self .channel .basic_publish
102
- PikaInstrumentation ._instrument_basic_publish (self .channel , tracer )
102
+ PikaInstrumentor ._instrument_basic_publish (self .channel , tracer )
103
103
decorate_basic_publish .assert_called_once_with (
104
104
original_function , self .channel , tracer
105
105
)
@@ -114,5 +114,5 @@ def test_uninstrument_channel_functions(self) -> None:
114
114
original_function = self .channel .basic_publish
115
115
self .channel .basic_publish = mock .MagicMock ()
116
116
self .channel .basic_publish ._original_function = original_function
117
- PikaInstrumentation ._uninstrument_channel_functions (self .channel )
117
+ PikaInstrumentor ._uninstrument_channel_functions (self .channel )
118
118
self .assertEqual (self .channel .basic_publish , original_function )
0 commit comments