[7.x] Add support for X-Opaque-Id

This commit is contained in:
Seth Michael Larson
2020-03-11 16:33:15 -05:00
committed by GitHub
parent 8074ff294b
commit 9219c92779
45 changed files with 1193 additions and 541 deletions
+18
View File
@@ -60,6 +60,24 @@ connection class::
Elasticsearch server. This timeout is internal and doesn't guarantee that the
request will end in the specified time.
Tracking Requests with Opaque ID
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can enrich your requests against Elasticsearch with an identifier string, that allows you to discover this identifier
in `deprecation logs <https://www.elastic.co/guide/en/elasticsearch/reference/7.4/logging.html#deprecation-logging>`_, to support you with
`identifying search slow log origin <https://www.elastic.co/guide/en/elasticsearch/reference/7.4/index-modules-slowlog.html#_identifying_search_slow_log_origin>`_
or to help with `identifying running tasks <https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#_identifying_running_tasks>`_.
.. code-block:: python
import elasticsearch
# You can add to the client to apply to all requests
client = elasticsearch.Elasticsearch(opaque_id="[email protected]_user1234")
# Or you can apply per-request for more granularity.
resp = client.get(index="test", id="1", opaque_id="[email protected]_user1234")
.. py:module:: elasticsearch