From b461942975b657c4aa9d87addc804f62ced045df Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 15 Jul 2022 22:23:19 +0530 Subject: [PATCH] Revert "update pymongo instrumentation" This reverts commit 53706488f509ebc07e9c4efe0a3cdd67ec9bd9ed. --- .../instrumentation/pymongo/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py index 51c8d46913..171979dbfe 100644 --- a/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py @@ -225,20 +225,20 @@ def _instrument(self, **kwargs): failed_hook = kwargs.get("failed_hook", dummy_callback) # Create and register a CommandTracer only the first time - if PymongoInstrumentor._commandtracer_instance is None: + if self._commandtracer_instance is None: tracer = get_tracer(__name__, __version__, tracer_provider) - PymongoInstrumentor._commandtracer_instance = CommandTracer( + self._commandtracer_instance = CommandTracer( tracer, request_hook=request_hook, response_hook=response_hook, failed_hook=failed_hook, ) - monitoring.register(PymongoInstrumentor._commandtracer_instance) + monitoring.register(self._commandtracer_instance) # If already created, just enable it - PymongoInstrumentor._commandtracer_instance.is_enabled = True + self._commandtracer_instance.is_enabled = True def _uninstrument(self, **kwargs): - if PymongoInstrumentor._commandtracer_instance is not None: - PymongoInstrumentor._commandtracer_instance.is_enabled = False + if self._commandtracer_instance is not None: + self._commandtracer_instance.is_enabled = False