Beispiel #1
0
def unpatch():
    if not getattr(starlette, "_datadog_patch", False):
        return

    setattr(starlette, "_datadog_patch", False)

    _u(starlette.applications.Starlette, "__init__")
Beispiel #2
0
def unpatch():
    if not getattr(fastapi, "_datadog_patch", False):
        return

    setattr(fastapi, "_datadog_patch", False)

    _u(fastapi.applications.FastAPI, "__init__")
Beispiel #3
0
def unpatch():
    if not getattr(fastapi, "_datadog_patch", False):
        return

    setattr(fastapi, "_datadog_patch", False)

    _u(fastapi.applications.FastAPI, "__init__")
    _u(fastapi.routing, "serialize_response")
Beispiel #4
0
def unpatch():
    # type: () -> None
    if not getattr(httpx, "_datadog_patch", False):
        return

    setattr(httpx, "_datadog_patch", False)

    _u(httpx.AsyncClient, "send")
    _u(httpx.Client, "send")
Beispiel #5
0
def unpatch():
    """Unpatch the instrumented methods."""
    if not getattr(sanic, "__datadog_patch", False):
        return

    if SANIC_VERSION >= (21, 9, 0):
        _u(sanic.Sanic, "__init__")
        _u(sanic.request.Request, "respond")
    else:
        _u(sanic.Sanic, "handle_request")
        if SANIC_VERSION >= (21, 0, 0):
            _u(sanic.Sanic, "_run_request_middleware")
            _u(sanic.request.Request, "respond")

    setattr(sanic, "__datadog_patch", False)
Beispiel #6
0
def unpatch():
    if algoliasearch_version == (0, 0):
        return

    if getattr(algoliasearch, DD_PATCH_ATTR, False):
        setattr(algoliasearch, DD_PATCH_ATTR, False)

        if algoliasearch_version < (2, 0) and algoliasearch_version >= (1, 0):
            _u(algoliasearch.index.Index, "search")
        elif algoliasearch_version >= (2, 0) and algoliasearch_version < (3,
                                                                          0):
            from algoliasearch import search_index

            _u(search_index.SearchIndex, "search")
        else:
            return
Beispiel #7
0
def unpatch():
    """Unpatch the instrumented methods."""
    _u(sanic.Sanic, "handle_request")
    if not SANIC_PRE_21:
        _u(sanic.Sanic, "_run_request_middleware")
        _u(sanic.request.Request, "respond")
    if not getattr(sanic, "__datadog_patch", False):
        return
    setattr(sanic, "__datadog_patch", False)
Beispiel #8
0
def unpatch():
    if not getattr(aioredis, "_datadog_patch", False):
        return

    setattr(aioredis, "_datadog_patch", False)
    if aioredis_version >= (2, 0):
        _u(aioredis.client.Redis, "execute_command")
        _u(aioredis.client.Redis, "pipeline")
        _u(aioredis.client.Pipeline, "execute")
    else:
        _u(aioredis.Redis, "execute")
        _u(aioredis.Redis, "pipeline")
        _u(aioredis.commands.transaction.Pipeline, "execute")
Beispiel #9
0
def unpatch():
    if getattr(aiopg, "_datadog_patch", False):
        setattr(aiopg, "_datadog_patch", False)
        _u(aiopg.connection, "_connect")
        _unpatch_extensions(_aiopg_extensions)