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/reference/observability.md
+9-29Lines changed: 9 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,41 +5,21 @@ mapped_pages:
5
5
6
6
# Observability [observability]
7
7
8
-
To observe and measure {{es}} client usage, several client features are provided.
8
+
Several client features help you observe and measure {{es}} client usage. As of version 8.15.0, the JavaScript client provides native support for OpenTelemetry. You can send client usage data to OpenTelemetry endpoints without making changes to your JavaScript codebase.
9
9
10
-
First, as of 8.15.0, the client provides native support for OpenTelemetry, which allows you to send client usage data to any endpoint that supports OpenTelemetry without having to make any changes to your JavaScript codebase.
11
-
12
-
Also, rather than providing a default logger, the client offers an event emitter interface to hook into internal events, such as `request` and `response`, allowing you to log the events you care about, or otherwise react to client usage however you might need.
13
-
14
-
Correlating events can be hard, especially if your applications have a large codebase with many events happening at the same time. To help you with this, the client provides a correlation ID system, and other features.
15
-
16
-
All of these observability features are documented below.
10
+
Rather than providing a default logger, the client offers an event emitter interface to hook into internal events like `request` and `response`. This allows you to log significant events or otherwise react to client usage. Because correlating events can be complex, the client provides a correlation ID system and other features.
17
11
18
12
## OpenTelemetry [_opentelemetry]
19
13
20
14
The client supports OpenTelemetry’s [zero-code instrumentation](https://opentelemetry.io/docs/zero-code/js/) to enable tracking each client request as an [OpenTelemetry span](https://opentelemetry.io/docs/concepts/signals/traces/#spans). These spans follow all of the [semantic OpenTelemetry conventions for {{es}}](https://opentelemetry.io/docs/specs/semconv/database/elasticsearch/) except for `db.query.text`.
21
15
22
-
To start sending {{es}} trace data to your OpenTelemetry endpoint, follow [OpenTelemetry’s zero-code instrumentation guide](https://opentelemetry.io/docs/zero-code/js/), or the following steps:
23
-
24
-
1. Install `@opentelemetry/api` and `@opentelemetry/auto-instrumentations-node` as Node.js dependencies
25
-
2. Export the following environment variables with the appropriate values:
26
-
27
-
*`OTEL_EXPORTER_OTLP_ENDPOINT`
28
-
*`OTEL_EXPORTER_OTLP_HEADERS`
29
-
*`OTEL_RESOURCE_ATTRIBUTES`
30
-
*`OTEL_SERVICE_NAME`
31
-
32
-
3.`require` the Node.js auto-instrumentation library at startup:
To start sending {{es}} trace data to your OpenTelemetry endpoint, instrument the client using the [Elastic Distribution of OpenTelemetry (EDOT) JavaScript](elastic-otel-node://reference/edot-node/index.md), or follow [OpenTelemetry’s zero-code instrumentation guide](https://opentelemetry.io/docs/zero-code/js/).
### Turn off OpenTelemetry collection [disable-otel]
39
19
40
-
As of `@elastic/transport` version 9.1.0—or 8.10.0 when using `@elastic/elasticsearch` 8.x—OpenTelemetry tracing can be disabled in multiple ways.
20
+
As of `@elastic/transport` version 9.1.0—or 8.10.0 when using `@elastic/elasticsearch` 8.x—you can turn off OpenTelemetry tracing in several ways.
41
21
42
-
To entirely disable OpenTelemetry collection, you can provide a custom `Transport` at client instantiation time that sets `openTelemetry.enabled` to `false`:
22
+
To entirely turn off OpenTelemetry collection, you can provide a custom `Transport` at client instantiation time that sets `openTelemetry.enabled` to `false`:
43
23
44
24
```typescript
45
25
import { Transport } from'@elastic/transport'
@@ -58,11 +38,11 @@ const client = new Client({
58
38
})
59
39
```
60
40
61
-
Alternatively, you can also export an environment variable `OTEL_ELASTICSEARCH_ENABLED=false` to achieve the same effect.
41
+
Alternatively, you can export the environment variable `OTEL_ELASTICSEARCH_ENABLED=false`.
62
42
63
-
If you would not like OpenTelemetry to be disabled entirely, but would like the client to suppress tracing, you can use the option `openTelemetry.suppressInternalInstrumentation = true` instead.
43
+
To suppress tracing without turning off all OpenTelemetry collection, use the option `openTelemetry.suppressInternalInstrumentation = true` instead.
64
44
65
-
If you would like to keep either option enabled by default, but want to disable them for a single API call, you can pass `Transport` options as a second argument to any API function call:
45
+
If you would like to keep either option enabled by default, but want to turn them off for a single API call, pass `Transport` options as a second argument to any API function call:
### Features and enhancements [elasticsearch-javascript-client-9.2.0-features-enhancements]
26
+
27
+
-**Compatibility with Elasticsearch 9.2:** All changes and additions to Elasticsearch APIs for its 9.2 release are reflected in this release.
28
+
29
+
-**Accepted parameter names added to transport request metadata:** All requests sent through `@elastic/transport` already included some metadata about the request (API name, path parameters). An `acceptedParams` array has been added that includes the names of all parameters that an API supports. This helps support more flexible pre-flight request modifications made by custom transports.
returnawaitthis.transport.request({ path, method, querystring, body, meta },options)
519
+
}
520
+
454
521
/**
455
522
* Get component templates. Get information about component templates in a cluster. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get component template API.
456
523
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-component-templates | Elasticsearch API documentation}
@@ -1434,7 +1501,12 @@ export default class Cat {
1434
1501
'h',
1435
1502
's',
1436
1503
'local',
1437
-
'master_timeout'
1504
+
'master_timeout',
1505
+
'expand_wildcards',
1506
+
'allow_no_indices',
1507
+
'ignore_throttled',
1508
+
'ignore_unavailable',
1509
+
'allow_closed'
1438
1510
]
1439
1511
}
1440
1512
returnawaitthis.transport.request({ path, method, querystring, body, meta },options)
0 commit comments