We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Elastic APM 6.13.0 agent errors when capturing long elasticsearch transactions
**Describe the bug**: 

**To Reproduce**

When capturing transactions to elasticsearch, Elastic APM throws errors when executing long transactions (e.g. async_scan), eventually causing the asynchronous event loop to cancel all tasks. 

```text
2022-10-31T09:05:05.200-04:00 | Traceback (most recent call last):
-- | --
  | 2022-10-31T09:05:05.200-04:00 | File "/usr/local/lib/python3.9/site-packages/elasticsearch/_async/helpers.py", line 490, in async_scan
  | 2022-10-31T09:05:05.200-04:00 | resp = await scroll_client.scroll(
  | 2022-10-31T09:05:05.200-04:00 | File "/usr/local/lib/python3.9/site-packages/elasticsearch/_async/client/__init__.py", line 3350, in scroll
  | 2022-10-31T09:05:05.200-04:00 | return await self.perform_request( # type: ignore[return-value]
  | 2022-10-31T09:05:05.200-04:00 | File "/usr/local/lib/python3.9/site-packages/elasticsearch/_async/client/_base.py", line 286, in perform_request
  | 2022-10-31T09:05:05.200-04:00 | meta, resp_body = await self.transport.perform_request(
  | 2022-10-31T09:05:05.200-04:00 | File "/usr/local/lib/python3.9/site-packages/elasticapm/instrumentation/packages/asyncio/elasticsearch.py", line 105, in call
  | 2022-10-31T09:05:05.200-04:00 | result_data = await wrapped(*args, **kwargs)
  | 2022-10-31T09:05:05.200-04:00 | File "/usr/local/lib/python3.9/site-packages/elastic_transport/_async_transport.py", line 272, in perform_request
  | 2022-10-31T09:05:05.200-04:00 | resp.meta.status,
  | 2022-10-31T09:05:05.200-04:00 | AttributeError: 'coroutine' object has no attribute 'meta'
```

Pinning elastic-apm~6.12.0 will solve the issue and it appears that it was introduced when Elasticsearch 8.0 support was added in [PR#1642](https://github.com/elastic/apm-agent-python/pull/1642/files) but I can't determine why because you guys did access the meta attribute safely with hasattr()? 

Please let me know if there is additional context I can add!

**Environment (please complete the following information)**
- OS: [e.g. Linux] debian:bullseye-slim (python:3.9-slim container image) x86
- Python version: 3.9
- Framework and version [e.g. Django 2.1]: N/A AWS Lambda Function
- APM Server version: 8.4.2
- Agent version: 6.13.0
- AWS Lambda Runtime: Custom container built w/ apm-lambda-extension.

```shell
$ pip3 freeze | grep elastic
elastic-apm==6.13.0
elastic-transport==8.4.0
elasticsearch==8.4.3
```

**Additional context**

Add any other context about the problem here.

- Agent config options <!-- be careful not to post sensitive information -->
  <details>
    <summary>Click to expand</summary>

    ```
    ELASTIC_APM_LOG_LEVEL: info
    ELASTIC_APM_DATA_RECEIVER_TIMEOUT_SECONDS: 15
    ELASTIC_APM_DATA_FORWARDER_TIMEOUT_SECONDS: 3
    ```
  </details>
- `requirements.txt`: Poetry in use (`tool.poetry.dependencies` in replace)
  <details>
    <summary>Click to expand</summary>

    ```
    [tool.poetry.dependencies]
    python = "^3.9"
    elasticsearch = "^8"
    elastic-apm = "^6.13"
    pandas = "^1.4.3"
    python-dotenv = "^0.21.0"
    requests = "^2.28.1"
    python-dateutil = "^2.8.2"
    boto3 = "^1.25.4"
    psycopg2-binary = "^2.9.3"
    aiohttp = "^3.8.1"
    validators = "^0.20.0"
    ```
  </details>


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `elasticapm/instrumentation/packages/asyncio/elasticsearch.py`
Content:
```
1 #  BSD 3-Clause License
2 #
3 #  Copyright (c) 2019, Elasticsearch BV
4 #  All rights reserved.
5 #
6 #  Redistribution and use in source and binary forms, with or without
7 #  modification, are permitted provided that the following conditions are met:
8 #
9 #  * Redistributions of source code must retain the above copyright notice, this
10 #    list of conditions and the following disclaimer.
11 #
12 #  * Redistributions in binary form must reproduce the above copyright notice,
13 #    this list of conditions and the following disclaimer in the documentation
14 #    and/or other materials provided with the distribution.
15 #
16 #  * Neither the name of the copyright holder nor the names of its
17 #    contributors may be used to endorse or promote products derived from
18 #    this software without specific prior written permission.
19 #
20 #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 #  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 #  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 #  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 #  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 #  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 #  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 #  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 #  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 #  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 import elasticapm
32 from elasticapm.instrumentation.packages.asyncio.base import AsyncAbstractInstrumentedModule
33 from elasticapm.instrumentation.packages.elasticsearch import (
34     ElasticsearchConnectionInstrumentation,
35     ElasticsearchTransportInstrumentation,
36 )
37 from elasticapm.traces import DroppedSpan, execution_context
38 
39 
40 class ElasticSearchAsyncConnection(ElasticsearchConnectionInstrumentation, AsyncAbstractInstrumentedModule):
41     name = "elasticsearch_connection"
42 
43     def get_instrument_list(self):
44         try:
45             import elastic_transport  # noqa: F401
46 
47             return [
48                 ("elastic_transport._node._http_aiohttp", "AiohttpHttpNode.perform_request"),
49             ]
50         except ImportError:
51             return [
52                 ("elasticsearch_async.connection", "AIOHttpConnection.perform_request"),
53                 ("elasticsearch._async.http_aiohttp", "AIOHttpConnection.perform_request"),
54             ]
55 
56     async def call(self, module, method, wrapped, instance, args, kwargs):
57         span = execution_context.get_span()
58         if not span or isinstance(span, DroppedSpan):
59             return wrapped(*args, **kwargs)
60 
61         self._update_context_by_request_data(span.context, instance, args, kwargs)
62 
63         result = await wrapped(*args, **kwargs)
64         if hasattr(result, "meta"):  # elasticsearch-py 8.x+
65             status_code = result.meta.status
66         else:
67             status_code = result[0]
68 
69         span.context["http"] = {"status_code": status_code}
70 
71         return result
72 
73 
74 class ElasticsearchAsyncTransportInstrumentation(
75     ElasticsearchTransportInstrumentation, AsyncAbstractInstrumentedModule
76 ):
77     name = "elasticsearch_connection"
78 
79     instrument_list = [
80         ("elasticsearch._async.transport", "AsyncTransport.perform_request"),
81     ]
82 
83     def get_instrument_list(self):
84         try:
85             import elastic_transport  # noqa: F401
86 
87             return [
88                 ("elastic_transport", "AsyncTransport.perform_request"),
89             ]
90         except ImportError:
91             return [
92                 ("elasticsearch._async.transport", "AsyncTransport.perform_request"),
93             ]
94 
95     async def call(self, module, method, wrapped, instance, args, kwargs):
96         async with elasticapm.async_capture_span(
97             self._get_signature(args, kwargs),
98             span_type="db",
99             span_subtype="elasticsearch",
100             span_action="query",
101             extra={},
102             skip_frames=2,
103             leaf=True,
104         ) as span:
105             result_data = await wrapped(*args, **kwargs)
106 
107             hits = self._get_hits(result_data)
108             if hits:
109                 span.context["db"]["rows_affected"] = hits
110 
111             return result_data
112
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/elasticapm/instrumentation/packages/asyncio/elasticsearch.py b/elasticapm/instrumentation/packages/asyncio/elasticsearch.py
--- a/elasticapm/instrumentation/packages/asyncio/elasticsearch.py
+++ b/elasticapm/instrumentation/packages/asyncio/elasticsearch.py
@@ -56,7 +56,7 @@
     async def call(self, module, method, wrapped, instance, args, kwargs):
         span = execution_context.get_span()
         if not span or isinstance(span, DroppedSpan):
-            return wrapped(*args, **kwargs)
+            return await wrapped(*args, **kwargs)
 
         self._update_context_by_request_data(span.context, instance, args, kwargs)

{"golden_diff": "diff --git a/elasticapm/instrumentation/packages/asyncio/elasticsearch.py b/elasticapm/instrumentation/packages/asyncio/elasticsearch.py\n--- a/elasticapm/instrumentation/packages/asyncio/elasticsearch.py\n+++ b/elasticapm/instrumentation/packages/asyncio/elasticsearch.py\n@@ -56,7 +56,7 @@\n     async def call(self, module, method, wrapped, instance, args, kwargs):\n         span = execution_context.get_span()\n         if not span or isinstance(span, DroppedSpan):\n-            return wrapped(*args, **kwargs)\n+            return await wrapped(*args, **kwargs)\n \n         self._update_context_by_request_data(span.context, instance, args, kwargs)\n", "issue": "Elastic APM 6.13.0 agent errors when capturing long elasticsearch transactions\n**Describe the bug**: \r\n\r\n**To Reproduce**\r\n\r\nWhen capturing transactions to elasticsearch, Elastic APM throws errors when executing long transactions (e.g. async_scan), eventually causing the asynchronous event loop to cancel all tasks. \r\n\r\n```text\r\n2022-10-31T09:05:05.200-04:00 | Traceback (most recent call last):\r\n-- | --\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | File \"/usr/local/lib/python3.9/site-packages/elasticsearch/_async/helpers.py\", line 490, in async_scan\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | resp = await scroll_client.scroll(\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | File \"/usr/local/lib/python3.9/site-packages/elasticsearch/_async/client/__init__.py\", line 3350, in scroll\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | return await self.perform_request( # type: ignore[return-value]\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | File \"/usr/local/lib/python3.9/site-packages/elasticsearch/_async/client/_base.py\", line 286, in perform_request\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | meta, resp_body = await self.transport.perform_request(\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | File \"/usr/local/lib/python3.9/site-packages/elasticapm/instrumentation/packages/asyncio/elasticsearch.py\", line 105, in call\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | result_data = await wrapped(*args, **kwargs)\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | File \"/usr/local/lib/python3.9/site-packages/elastic_transport/_async_transport.py\", line 272, in perform_request\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | resp.meta.status,\r\n\u00a0 | 2022-10-31T09:05:05.200-04:00 | AttributeError: 'coroutine' object has no attribute 'meta'\r\n```\r\n\r\nPinning elastic-apm~6.12.0 will solve the issue and it appears that it was introduced when Elasticsearch 8.0 support was added in [PR#1642](https://github.com/elastic/apm-agent-python/pull/1642/files) but I can't determine why because you guys did access the meta attribute safely with hasattr()? \r\n\r\nPlease let me know if there is additional context I can add!\r\n\r\n**Environment (please complete the following information)**\r\n- OS: [e.g. Linux] debian:bullseye-slim (python:3.9-slim container image) x86\r\n- Python version: 3.9\r\n- Framework and version [e.g. Django 2.1]: N/A AWS Lambda Function\r\n- APM Server version: 8.4.2\r\n- Agent version: 6.13.0\r\n- AWS Lambda Runtime: Custom container built w/ apm-lambda-extension.\r\n\r\n```shell\r\n$ pip3 freeze | grep elastic\r\nelastic-apm==6.13.0\r\nelastic-transport==8.4.0\r\nelasticsearch==8.4.3\r\n```\r\n\r\n**Additional context**\r\n\r\nAdd any other context about the problem here.\r\n\r\n- Agent config options <!-- be careful not to post sensitive information -->\r\n  <details>\r\n    <summary>Click to expand</summary>\r\n\r\n    ```\r\n    ELASTIC_APM_LOG_LEVEL: info\r\n    ELASTIC_APM_DATA_RECEIVER_TIMEOUT_SECONDS: 15\r\n    ELASTIC_APM_DATA_FORWARDER_TIMEOUT_SECONDS: 3\r\n    ```\r\n  </details>\r\n- `requirements.txt`: Poetry in use (`tool.poetry.dependencies` in replace)\r\n  <details>\r\n    <summary>Click to expand</summary>\r\n\r\n    ```\r\n    [tool.poetry.dependencies]\r\n    python = \"^3.9\"\r\n    elasticsearch = \"^8\"\r\n    elastic-apm = \"^6.13\"\r\n    pandas = \"^1.4.3\"\r\n    python-dotenv = \"^0.21.0\"\r\n    requests = \"^2.28.1\"\r\n    python-dateutil = \"^2.8.2\"\r\n    boto3 = \"^1.25.4\"\r\n    psycopg2-binary = \"^2.9.3\"\r\n    aiohttp = \"^3.8.1\"\r\n    validators = \"^0.20.0\"\r\n    ```\r\n  </details>\r\n\n", "before_files": [{"content": "#  BSD 3-Clause License\n#\n#  Copyright (c) 2019, Elasticsearch BV\n#  All rights reserved.\n#\n#  Redistribution and use in source and binary forms, with or without\n#  modification, are permitted provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this\n#    list of conditions and the following disclaimer.\n#\n#  * Redistributions in binary form must reproduce the above copyright notice,\n#    this list of conditions and the following disclaimer in the documentation\n#    and/or other materials provided with the distribution.\n#\n#  * Neither the name of the copyright holder nor the names of its\n#    contributors may be used to endorse or promote products derived from\n#    this software without specific prior written permission.\n#\n#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n#  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n#  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n#  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n#  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nimport elasticapm\nfrom elasticapm.instrumentation.packages.asyncio.base import AsyncAbstractInstrumentedModule\nfrom elasticapm.instrumentation.packages.elasticsearch import (\n    ElasticsearchConnectionInstrumentation,\n    ElasticsearchTransportInstrumentation,\n)\nfrom elasticapm.traces import DroppedSpan, execution_context\n\n\nclass ElasticSearchAsyncConnection(ElasticsearchConnectionInstrumentation, AsyncAbstractInstrumentedModule):\n    name = \"elasticsearch_connection\"\n\n    def get_instrument_list(self):\n        try:\n            import elastic_transport  # noqa: F401\n\n            return [\n                (\"elastic_transport._node._http_aiohttp\", \"AiohttpHttpNode.perform_request\"),\n            ]\n        except ImportError:\n            return [\n                (\"elasticsearch_async.connection\", \"AIOHttpConnection.perform_request\"),\n                (\"elasticsearch._async.http_aiohttp\", \"AIOHttpConnection.perform_request\"),\n            ]\n\n    async def call(self, module, method, wrapped, instance, args, kwargs):\n        span = execution_context.get_span()\n        if not span or isinstance(span, DroppedSpan):\n            return wrapped(*args, **kwargs)\n\n        self._update_context_by_request_data(span.context, instance, args, kwargs)\n\n        result = await wrapped(*args, **kwargs)\n        if hasattr(result, \"meta\"):  # elasticsearch-py 8.x+\n            status_code = result.meta.status\n        else:\n            status_code = result[0]\n\n        span.context[\"http\"] = {\"status_code\": status_code}\n\n        return result\n\n\nclass ElasticsearchAsyncTransportInstrumentation(\n    ElasticsearchTransportInstrumentation, AsyncAbstractInstrumentedModule\n):\n    name = \"elasticsearch_connection\"\n\n    instrument_list = [\n        (\"elasticsearch._async.transport\", \"AsyncTransport.perform_request\"),\n    ]\n\n    def get_instrument_list(self):\n        try:\n            import elastic_transport  # noqa: F401\n\n            return [\n                (\"elastic_transport\", \"AsyncTransport.perform_request\"),\n            ]\n        except ImportError:\n            return [\n                (\"elasticsearch._async.transport\", \"AsyncTransport.perform_request\"),\n            ]\n\n    async def call(self, module, method, wrapped, instance, args, kwargs):\n        async with elasticapm.async_capture_span(\n            self._get_signature(args, kwargs),\n            span_type=\"db\",\n            span_subtype=\"elasticsearch\",\n            span_action=\"query\",\n            extra={},\n            skip_frames=2,\n            leaf=True,\n        ) as span:\n            result_data = await wrapped(*args, **kwargs)\n\n            hits = self._get_hits(result_data)\n            if hits:\n                span.context[\"db\"][\"rows_affected\"] = hits\n\n            return result_data\n", "path": "elasticapm/instrumentation/packages/asyncio/elasticsearch.py"}], "after_files": [{"content": "#  BSD 3-Clause License\n#\n#  Copyright (c) 2019, Elasticsearch BV\n#  All rights reserved.\n#\n#  Redistribution and use in source and binary forms, with or without\n#  modification, are permitted provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this\n#    list of conditions and the following disclaimer.\n#\n#  * Redistributions in binary form must reproduce the above copyright notice,\n#    this list of conditions and the following disclaimer in the documentation\n#    and/or other materials provided with the distribution.\n#\n#  * Neither the name of the copyright holder nor the names of its\n#    contributors may be used to endorse or promote products derived from\n#    this software without specific prior written permission.\n#\n#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n#  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n#  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n#  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n#  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n#  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n#  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nimport elasticapm\nfrom elasticapm.instrumentation.packages.asyncio.base import AsyncAbstractInstrumentedModule\nfrom elasticapm.instrumentation.packages.elasticsearch import (\n    ElasticsearchConnectionInstrumentation,\n    ElasticsearchTransportInstrumentation,\n)\nfrom elasticapm.traces import DroppedSpan, execution_context\n\n\nclass ElasticSearchAsyncConnection(ElasticsearchConnectionInstrumentation, AsyncAbstractInstrumentedModule):\n    name = \"elasticsearch_connection\"\n\n    def get_instrument_list(self):\n        try:\n            import elastic_transport  # noqa: F401\n\n            return [\n                (\"elastic_transport._node._http_aiohttp\", \"AiohttpHttpNode.perform_request\"),\n            ]\n        except ImportError:\n            return [\n                (\"elasticsearch_async.connection\", \"AIOHttpConnection.perform_request\"),\n                (\"elasticsearch._async.http_aiohttp\", \"AIOHttpConnection.perform_request\"),\n            ]\n\n    async def call(self, module, method, wrapped, instance, args, kwargs):\n        span = execution_context.get_span()\n        if not span or isinstance(span, DroppedSpan):\n            return await wrapped(*args, **kwargs)\n\n        self._update_context_by_request_data(span.context, instance, args, kwargs)\n\n        result = await wrapped(*args, **kwargs)\n        if hasattr(result, \"meta\"):  # elasticsearch-py 8.x+\n            status_code = result.meta.status\n        else:\n            status_code = result[0]\n\n        span.context[\"http\"] = {\"status_code\": status_code}\n\n        return result\n\n\nclass ElasticsearchAsyncTransportInstrumentation(\n    ElasticsearchTransportInstrumentation, AsyncAbstractInstrumentedModule\n):\n    name = \"elasticsearch_connection\"\n\n    instrument_list = [\n        (\"elasticsearch._async.transport\", \"AsyncTransport.perform_request\"),\n    ]\n\n    def get_instrument_list(self):\n        try:\n            import elastic_transport  # noqa: F401\n\n            return [\n                (\"elastic_transport\", \"AsyncTransport.perform_request\"),\n            ]\n        except ImportError:\n            return [\n                (\"elasticsearch._async.transport\", \"AsyncTransport.perform_request\"),\n            ]\n\n    async def call(self, module, method, wrapped, instance, args, kwargs):\n        async with elasticapm.async_capture_span(\n            self._get_signature(args, kwargs),\n            span_type=\"db\",\n            span_subtype=\"elasticsearch\",\n            span_action=\"query\",\n            extra={},\n            skip_frames=2,\n            leaf=True,\n        ) as span:\n            result_data = await wrapped(*args, **kwargs)\n\n            hits = self._get_hits(result_data)\n            if hits:\n                span.context[\"db\"][\"rows_affected\"] = hits\n\n            return result_data\n", "path": "elasticapm/instrumentation/packages/asyncio/elasticsearch.py"}]}