elastic / elastic-transport-python

Transport classes and utilities shared among Python Elastic client libraries
https://elastic-transport-python.readthedocs.io
Apache License 2.0
20 stars 13 forks source link

Accept endpoint_id and path_params from client #151

Closed pquentin closed 6 months ago

pquentin commented 6 months ago

Relates https://github.com/elastic/elasticsearch-py/issues/2435

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:

image

and adds path parts attributes (Elastic APM replaces dots with underscores):

image

I also added support for AsyncTransport:

image

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.