From 1877fb01b6cf0528e3b992eefaf5584244cbdd3e Mon Sep 17 00:00:00 2001 From: Andrew Ross Date: Tue, 26 Nov 2024 13:40:46 -0800 Subject: [PATCH] Document the `X-Opaque-Id` header A [bug][1] was recently identified related to this header that was partly exascerbated by a misuse of the field. We have some documentation related to the [Tasks][2] API for this field, but no general guidance on how to use it. [1]: https://github.com/opensearch-project/OpenSearch/issues/16702 [2]: https://opensearch.org/docs/latest/api-reference/tasks/#attaching-headers-to-tasks Signed-off-by: Andrew Ross --- _api-reference/common-parameters.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/_api-reference/common-parameters.md b/_api-reference/common-parameters.md index 5b536ad992..70a103ba1a 100644 --- a/_api-reference/common-parameters.md +++ b/_api-reference/common-parameters.md @@ -123,4 +123,17 @@ Kilometers | `km` or `kilometers` Meters | `m` or `meters` Centimeters | `cm` or `centimeters` Millimeters | `mm` or `millimeters` -Nautical miles | `NM`, `nmi`, or `nauticalmiles` \ No newline at end of file +Nautical miles | `NM`, `nmi`, or `nauticalmiles` + +## `X-Opaque-Id` Header + +You can specify an opaque identifier on any request using the `X-Opaque-Id` header. This identifier is used to track tasks and deduplicate deprecation warnings in server side logs. This identifier is intended to differentiate different callers into your OpenSearch cluster. Do not specify a unique value per request. + +#### Example request + +The following request adds an opaque ID to the request: + +```json + +curl -H "X-Opaque-Id: my-curl-client-1" -XGET localhost:9200/_tasks +``` \ No newline at end of file