From a6ec4d542bbc9215512d6887ffdf0bb2d5df60e9 Mon Sep 17 00:00:00 2001 From: Matthew Chubb Date: Fri, 12 Apr 2019 14:13:34 +0100 Subject: [PATCH] Add trace_config param to connection This will allow support for AWS X-Ray integration, via trace_config passed to aiohttp.ClientSession See https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python-httpclients.html for more details --- elasticsearch_async/connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elasticsearch_async/connection.py b/elasticsearch_async/connection.py index 6d3c912..b511f2e 100644 --- a/elasticsearch_async/connection.py +++ b/elasticsearch_async/connection.py @@ -16,7 +16,7 @@ class AIOHttpConnection(Connection): def __init__(self, host='localhost', port=9200, http_auth=None, use_ssl=False, verify_certs=False, ca_certs=None, client_cert=None, client_key=None, loop=None, use_dns_cache=True, headers=None, - ssl_context=None, **kwargs): + ssl_context=None, trace_configs=None, **kwargs): super().__init__(host=host, port=port, **kwargs) self.loop = asyncio.get_event_loop() if loop is None else loop @@ -71,6 +71,7 @@ def __init__(self, host='localhost', port=9200, http_auth=None, verify_ssl=verify_certs, use_dns_cache=use_dns_cache, ssl_context=ssl_context, + trace_configs=trace_configs, ), headers=headers )