You can find integration options and information on this page.

OpenTelemetry instrumentationedit

The Python Elasticsearch client supports native OpenTelemetry instrumentation following the OpenTelemetry Semantic Conventions for Elasticsearch. Refer to the Using OpenTelemetry page for details.


ES|QL is available through the Python Elasticsearch client. Refer to the ES|QL and Pandas page to learn more about using ES|QL and Pandas together with dataframes.


The handling of connections, retries, and pooling is handled by the Elastic Transport Python library. Documentation on the low-level classes is available on Read the Docs.

Tracking requests with Opaque IDedit

You can enrich your requests against Elasticsearch with an identifier string, that allows you to discover this identifier in deprecation logs, to support you with identifying search slow log origin or to help with identifying running tasks.

The opaque ID can be set via the opaque_id parameter via the client .options() method:

client = Elasticsearch(...)

Type Hintsedit

Starting in elasticsearch-py v7.10.0 the library now ships with type hints and supports basic static type analysis with tools like Mypy and Pyright.

If we write a script that has a type error like using request_timeout with a str argument instead of float and then run Mypy on the script:

from elasticsearch import Elasticsearch

client = Elasticsearch(...)
    request_timeout="5"  # type error!

# $ mypy
# error: Argument "request_timeout" to "search" of "Elasticsearch" has
#                     incompatible type "str"; expected "Union[int, float, None]"
# Found 1 error in 1 file (checked 1 source file)

Type hints also allow tools like your IDE to check types and provide better auto-complete functionality.