You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.asciidoc
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,6 +173,11 @@ function generateRequestId (params, options) {
173
173
|`string` - The name to identify the client instance in the events. +
174
174
_Default:_ `elasticsearch-js`
175
175
176
+
|`opaqueIdPrefix`
177
+
|`string` - A string that will be use to prefix any `X-Opaque-Id` header. +
178
+
See https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/observability.html#_x-opaque-id_support[`X-Opaque-Id` support] for more details. +
179
+
_Default:_ `null`
180
+
176
181
|`headers`
177
182
|`object` - A set of custom headers to send in every request. +
Copy file name to clipboardExpand all lines: docs/observability.asciidoc
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -248,3 +248,46 @@ child.search({
248
248
if (err) console.log(err)
249
249
})
250
250
----
251
+
252
+
=== X-Opaque-Id support
253
+
To improve the overall observability, the client offers an easy way to configure the `X-Opaque-Id` header. If you set the `X-Opaque-Id` in a specific request, this will allow you to discover this identifier in the https://www.elastic.co/guide/en/elasticsearch/reference/master/logging.html#deprecation-logging[deprecation logs], help you with https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin] as well as https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks[identifying running tasks].
254
+
255
+
The `X-Opaque-Id` should be configured in each request, for doing that you can use the `opaqueId` option, as you can see in the following example. +
256
+
The resulting header will be `{ 'X-Opaque-Id': 'my-search' }`.
Sometimes it may be useful to prefix all the `X-Opaque-Id` headers with a specific string, in case you need to identify a specific client or server. For doing this, the client offers a top-level configuration option: `opaqueIdPrefix`. +
276
+
In the following example, the resulting header will be `{ 'X-Opaque-Id': 'proxy-client::my-search' }`.
0 commit comments