Skip to content

Commit 5370648

Browse files
committed
update pymongo instrumentation
1 parent 07f63c0 commit 5370648

File tree

1 file changed

+6
-6
lines changed
  • instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo

1 file changed

+6
-6
lines changed

instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -225,20 +225,20 @@ def _instrument(self, **kwargs):
225225
failed_hook = kwargs.get("failed_hook", dummy_callback)
226226

227227
# Create and register a CommandTracer only the first time
228-
if self._commandtracer_instance is None:
228+
if PymongoInstrumentor._commandtracer_instance is None:
229229
tracer = get_tracer(__name__, __version__, tracer_provider)
230230

231-
self._commandtracer_instance = CommandTracer(
231+
PymongoInstrumentor._commandtracer_instance = CommandTracer(
232232
tracer,
233233
request_hook=request_hook,
234234
response_hook=response_hook,
235235
failed_hook=failed_hook,
236236
)
237-
monitoring.register(self._commandtracer_instance)
237+
monitoring.register(PymongoInstrumentor._commandtracer_instance)
238238

239239
# If already created, just enable it
240-
self._commandtracer_instance.is_enabled = True
240+
PymongoInstrumentor._commandtracer_instance.is_enabled = True
241241

242242
def _uninstrument(self, **kwargs):
243-
if self._commandtracer_instance is not None:
244-
self._commandtracer_instance.is_enabled = False
243+
if PymongoInstrumentor._commandtracer_instance is not None:
244+
PymongoInstrumentor._commandtracer_instance.is_enabled = False

0 commit comments

Comments
 (0)