This pull request changes perform_request to optionally accept endpoint_id and path_parts from the Elasticsearch client. Coupled with https://github.com/elastic/elasticsearch-py/pull/2457, this fixes the span name:
and adds path parts attributes (Elastic APM replaces dots with underscores):
I also added support for AsyncTransport:
It was convenient because the elasticsearch-py changes also apply to the async API, but I can open a separate pull request to bring OTel support to AsyncTransport first if you prefer.
I have done all my testing manually but I do plan to add an integration test in the future.
Relates https://github.com/elastic/elasticsearch-py/issues/2435
This pull request changes
perform_request
to optionally acceptendpoint_id
andpath_parts
from the Elasticsearch client. Coupled with https://github.com/elastic/elasticsearch-py/pull/2457, this fixes the span name:and adds path parts attributes (Elastic APM replaces dots with underscores):
I also added support for AsyncTransport:
It was convenient because the elasticsearch-py changes also apply to the async API, but I can open a separate pull request to bring OTel support to AsyncTransport first if you prefer.
I have done all my testing manually but I do plan to add an integration test in the future.