def _uninstall(config): for patch_class_path in config["patch"]: patch_mod, _, patch_class = patch_class_path.rpartition(".") mod = importlib.import_module(patch_mod) cls = getattr(mod, patch_class, None) if not cls: log.debug(""" Unable to find corresponding class for tracing configuration. This version may not be supported. """) continue for patch_routine in config["patch"][patch_class_path]["routines"]: unwrap(cls, patch_routine)
def _unpatch(django): unwrap(django.apps.registry.Apps, "populate") unwrap(django.core.handlers.base.BaseHandler, "load_middleware") unwrap(django.core.handlers.base.BaseHandler, "get_response") unwrap(django.template.base.Template, "render") unwrap(django.conf.urls.static, "static") unwrap(django.conf.urls, "url") if django.VERSION >= (2, 0, 0): unwrap(django.urls, "path") unwrap(django.urls, "re_path") unwrap(django.views.generic.base.View, "as_view") for conn in django.db.connections.all(): unwrap(conn, "cursor") unwrap(django.db.connections, "all")
def unpatch(): if getattr(mariadb, "_datadog_patch", False): setattr(mariadb, "_datadog_patch", False) unwrap(mariadb, "connect")
def unpatch(): if getattr(rediscluster, "_datadog_patch", False): setattr(rediscluster, "_datadog_patch", False) if REDISCLUSTER_VERSION >= (2, 0, 0): unwrap(rediscluster.client.RedisCluster, "execute_command") unwrap(rediscluster.client.RedisCluster, "pipeline") unwrap(rediscluster.pipeline.ClusterPipeline, "execute") else: unwrap(rediscluster.StrictRedisCluster, "execute_command") unwrap(rediscluster.StrictRedisCluster, "pipeline") unwrap(rediscluster.StrictClusterPipeline, "execute")
def unpatch(): if getattr(boto.connection, "_datadog_patch", False): setattr(boto.connection, "_datadog_patch", False) unwrap(boto.connection.AWSQueryConnection, "make_request") unwrap(boto.connection.AWSAuthConnection, "make_request")