Elasticsearch REST Client
OpenTelemetry Java agent instrumentation
This instrumentation enables database client spans and database client metrics for Elasticsearch REST clients.
- Name:
elasticsearch-rest-5.0 - Scope:
io.opentelemetry.elasticsearch-rest-5.0 - Target versions:
org.elasticsearch.client:elasticsearch-rest-client:[5.0,6.4),org.elasticsearch.client:rest:[5.0,6.4) - Library: https://www.elastic.co/guide/en/elasticsearch/client/java-rest
Telemetry
When default
Spans
| Span kind | Attributes |
|---|---|
| CLIENT | db.system (STRING), http.request.method (STRING), server.address (STRING), server.port (LONG), url.full (STRING) |
When otel.semconv-stability.opt-in=database
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
db.client.operation.duration | histogram | HISTOGRAM | s | Duration of database client operations. |
| Metric | Attributes |
|---|---|
db.client.operation.duration | db.system.name (STRING), server.address (STRING), server.port (LONG) |
Spans
| Span kind | Attributes |
|---|---|
| CLIENT | db.system.name (STRING), http.request.method (STRING), server.address (STRING), server.port (LONG), url.full (STRING) |
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
java.common.database.statement_sanitizer.enabled | boolean | true | Deprecated: use java.common.db.query_sanitization.enabled instead. It is ignored under v3 preview. |
otel.instrumentation.common.db-statement-sanitizer.enabled | boolean | true | Deprecated: use otel.instrumentation.common.db.query-sanitization.enabled instead. It is ignored under v3 preview and will be removed in 3.0. |
otel.instrumentation.common.db.query-sanitization.enabled | boolean | true | Enables query sanitization for database queries. |
otel.instrumentation.http.known-methods | list | CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE | Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as _OTHER. |
otel.instrumentation.elasticsearch.capture-search-query | boolean | false | Deprecated for removal in 3.0 with no replacement. Outside v3-preview, explicitly set this to capture or omit search query bodies. Under v3-preview and in 3.0, the setting is ignored and search query bodies are always captured. Sanitization remains separately configurable with otel.instrumentation.elasticsearch.query-sanitization.enabled. |
otel.instrumentation.elasticsearch.query-sanitization.enabled | boolean | Enables sanitization of the captured search query bodies. Overrides otel.instrumentation.common.db.query-sanitization.enabled for this instrumentation; when unset, that setting applies. | |
otel.instrumentation.elasticsearch.statement-sanitizer.enabled | boolean | Deprecated: use otel.instrumentation.elasticsearch.query-sanitization.enabled instead. It is ignored under v3 preview and will be removed in 3.0. When unset, this setting falls back to otel.instrumentation.common.db.query-sanitization.enabled (including its deprecated aliases). |