Skip to content

Commit

Permalink
Revert "update pymongo instrumentation"
Browse files Browse the repository at this point in the history
This reverts commit 5370648.
  • Loading branch information
srikanthccv committed Jul 15, 2022
1 parent 5370648 commit b461942
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b461942

Please sign in to comment.