Skip to content

Commit 9902232

Browse files
authored
Update observability.md
Fixes elastic/docs-content-internal#401
1 parent 6443938 commit 9902232

File tree

1 file changed

+8
-28
lines changed

1 file changed

+8
-28
lines changed

docs/reference/observability.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,21 @@ mapped_pages:
55

66
# Observability [observability]
77

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 JS 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.
99

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, such as `request` and `response`, allowing you to log the events you care about, or otherwise react to client usage however you might need. Because correlating events can be hard, the client provides a correlation ID system, and other features.
1711

1812
## OpenTelemetry [_opentelemetry]
1913

2014
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`.
2115

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:
33-
34-
```
35-
node --require '@opentelemetry/auto-instrumentations-node/register' index.js
36-
```
16+
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/).
3717

38-
### Disabling OpenTelemetry collection [disable-otel]
18+
### Turn off OpenTelemetry collection [disable-otel]
3919

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.
4121

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`:
4323

4424
```typescript
4525
import { Transport } from '@elastic/transport'
@@ -60,9 +40,9 @@ const client = new Client({
6040

6141
Alternatively, you can also export an environment variable `OTEL_ELASTICSEARCH_ENABLED=false` to achieve the same effect.
6242

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+
If you would not like OpenTelemetry to be turned off entirely, but would like the client to suppress tracing, use the option `openTelemetry.suppressInternalInstrumentation = true` instead.
6444

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:
6646

6747
```typescript
6848
const response = await client.search({ ... }, {

0 commit comments

Comments
 (0)