def patch(): if getattr(botocore.client, "_datadog_patch", False): return setattr(botocore.client, "_datadog_patch", True) wrapt.wrap_function_wrapper("botocore.client", "BaseClient._make_api_call", patched_api_call) Pin(service="aws", app="aws").onto(botocore.client.BaseClient)
def patch(): """Instrument Pylons applications""" if getattr(pylons.wsgiapp, '_datadog_patch', False): return setattr(pylons.wsgiapp, '_datadog_patch', True) wrapt.wrap_function_wrapper('pylons.wsgiapp', 'PylonsApp.__init__', traced_init)
def _patch_extensions(_extensions): # we must patch extensions all the time (it's pretty harmless) so split # from global patching of connections. must be idempotent. for _, module, func, wrapper in _extensions: if not hasattr(module, func) or isinstance(getattr(module, func), wrapt.ObjectProxy): continue wrapt.wrap_function_wrapper(module, func, wrapper)
def patch(): if getattr(botocore.client, '_datadog_patch', False): return setattr(botocore.client, '_datadog_patch', True) wrapt.wrap_function_wrapper('botocore.client', 'BaseClient._make_api_call', patched_api_call) Pin(service='aws', app='aws').onto(botocore.client.BaseClient)
def patch(): """Patch the bottle.Bottle class""" if getattr(bottle, "_datadog_patch", False): return setattr(bottle, "_datadog_patch", True) wrapt.wrap_function_wrapper("bottle", "Bottle.__init__", traced_init)
def patch(): if getattr(pynamodb.connection.base, "_datadog_patch", False): return setattr(pynamodb.connection.base, "_datadog_patch", True) wrapt.wrap_function_wrapper("pynamodb.connection.base", "Connection._make_api_call", patched_api_call) Pin(service=None).onto(pynamodb.connection.base.Connection)
def patch(): if getattr(aiobotocore.client, '_datadog_patch', False): return setattr(aiobotocore.client, '_datadog_patch', True) wrapt.wrap_function_wrapper('aiobotocore.client', 'AioBaseClient._make_api_call', _wrapped_api_call) Pin(service=config.service or "aws", app="aws").onto(aiobotocore.client.AioBaseClient)
def patch(): """Instrument Pylons applications""" if getattr(pylons.wsgiapp, "_datadog_patch", False): return setattr(pylons.wsgiapp, "_datadog_patch", True) wrapt.wrap_function_wrapper("pylons.wsgiapp", "PylonsApp.__init__", traced_init)
def patch(): """Patch the bottle.Bottle class """ if getattr(bottle, '_datadog_patch', False): return setattr(bottle, '_datadog_patch', True) wrapt.wrap_function_wrapper('bottle', 'Bottle.__init__', traced_init)
def includeme(config): # Add our tween just before the default exception handler config.add_tween(DD_TWEEN_NAME, over=pyramid.tweens.EXCVIEW) # ensure we only patch the renderer once. if not isinstance(pyramid.renderers.RendererHelper.render, wrapt.ObjectProxy): wrapt.wrap_function_wrapper('pyramid.renderers', 'RendererHelper.render', trace_render)
def patch(): if getattr(aiobotocore.client, "_datadog_patch", False): return setattr(aiobotocore.client, "_datadog_patch", True) wrapt.wrap_function_wrapper("aiobotocore.client", "AioBaseClient._make_api_call", _wrapped_api_call) Pin(service=config.service or "aws").onto(aiobotocore.client.AioBaseClient)
def patch(): """Patch monkey patches psycopg's connection function so that the connection's functions are traced. """ if getattr(psycopg2, "_datadog_patch", False): return setattr(psycopg2, "_datadog_patch", True) wrapt.wrap_function_wrapper(psycopg2, "connect", patched_connect) _patch_extensions(_psycopg2_extensions) # do this early just in case
def patch(): """ Patch monkey patches psycopg's connection function so that the connection's functions are traced. """ if getattr(aiopg, '_datadog_patch', False): return setattr(aiopg, '_datadog_patch', True) wrapt.wrap_function_wrapper(aiopg.connection, '_connect', patched_connect) _patch_extensions(_aiopg_extensions) # do this early just in case
def patch(): """ Patch falcon.API to include contrib.falcon.TraceMiddleware by default """ if getattr(falcon, "_datadog_patch", False): return setattr(falcon, "_datadog_patch", True) wrapt.wrap_function_wrapper("falcon", "API.__init__", traced_init)
def patch(): import snowflake.connector if getattr(snowflake.connector, "_datadog_patch", False): return setattr(snowflake.connector, "_datadog_patch", True) wrapt.wrap_function_wrapper(snowflake.connector, "Connect", patched_connect) wrapt.wrap_function_wrapper(snowflake.connector, "connect", patched_connect)
def patch(): if getattr(boto.connection, "_datadog_patch", False): return setattr(boto.connection, "_datadog_patch", True) # AWSQueryConnection and AWSAuthConnection are two different classes called by # different services for connection. # For example EC2 uses AWSQueryConnection and S3 uses AWSAuthConnection wrapt.wrap_function_wrapper("boto.connection", "AWSQueryConnection.make_request", patched_query_request) wrapt.wrap_function_wrapper("boto.connection", "AWSAuthConnection.make_request", patched_auth_request) Pin(service="aws", app="aws").onto(boto.connection.AWSQueryConnection) Pin(service="aws", app="aws").onto(boto.connection.AWSAuthConnection)
def patch(): if getattr(boto.connection, '_datadog_patch', False): return setattr(boto.connection, '_datadog_patch', True) # AWSQueryConnection and AWSAuthConnection are two different classes called by # different services for connection. # For exemple EC2 uses AWSQueryConnection and S3 uses AWSAuthConnection wrapt.wrap_function_wrapper('boto.connection', 'AWSQueryConnection.make_request', patched_query_request) wrapt.wrap_function_wrapper('boto.connection', 'AWSAuthConnection.make_request', patched_auth_request) Pin(service='aws', app='aws').onto(boto.connection.AWSQueryConnection) Pin(service='aws', app='aws').onto(boto.connection.AWSAuthConnection)
def patch(): wrapt.wrap_function_wrapper("mysql.connector", "connect", _connect) # `Connect` is an alias for `connect`, patch it too if hasattr(mysql.connector, "Connect"): mysql.connector.Connect = mysql.connector.connect
def patch(): wrapt.wrap_function_wrapper('mysql.connector', 'connect', _connect) # `Connect` is an alias for `connect`, patch it too if hasattr(mysql.connector, 'Connect'): mysql.connector.Connect = mysql.connector.connect
def patch(): wrapt.wrap_function_wrapper('pymysql', 'connect', _connect)
def patch(): if getattr(mariadb, "_datadog_patch", False): return setattr(mariadb, "_datadog_patch", True) wrapt.wrap_function_wrapper("mariadb", "connect", _connect)
def patch(): wrapt.wrap_function_wrapper("pymysql", "connect", _connect)