def uninstall(self): if not self.installed: logger.info("Jinja2 instruments are not installed. Skipping.") return False self.installed = False from jinja2 import Template unpatch_method(Template, "render")
def uninstall(self): if not self.installed: logger.info("Urllib3 instruments are not installed. Skipping.") return False self.installed = False from urllib3 import HTTPConnectionPool unpatch_method(HTTPConnectionPool, "urlopen")
def uninstall(self): if not self.installed: logger.info("PyMongo instruments are not installed. Skipping.") return False self.installed = False from pymongo.collection import Collection for method_str in self.__class__.PYMONGO_METHODS: unpatch_method(Collection, method_str)
def test_trace_method_no_name(tracked_request): @trace_method(TraceMe) # noqa: F811 def trace_me(self, *args, **kwargs): return ("Test/Method", {"name": None}) try: TraceMe().trace_me() finally: unpatch_method(TraceMe, "trace_me") span = tracked_request.complete_spans[0] assert span.operation == "Test/Method"
def unpatch_redis(self): Redis, _Pipeline = import_Redis_and_Pipeline() unpatch_method(Redis, "execute_command")
def unpatch_pipeline(self): _Redis, Pipeline = import_Redis_and_Pipeline() unpatch_method(Pipeline, "execute")
def uninstrument_transport(self): from elasticsearch import Transport unpatch_method(Transport, "perform_request")
def uninstrument_client(self): from elasticsearch import Elasticsearch for method_str in self.__class__.CLIENT_METHODS: unpatch_method(Elasticsearch, method_str)