Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 201 additions & 14 deletions docs/instrumentation-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2278,18 +2278,73 @@ libraries:
attributes: []
elasticsearch:
- name: elasticsearch-api-client-7.16
description: This instrumentation enables client spans for Elasticsearch API client
requests for version 7 of the client. Versions 8.10 and later have native support
for OpenTelemetry.
description: |
This instrumentation extends the elasticsearch-rest-7.0 instrumentation by adding additional `db.elasticsearch.path_parts.id` and `db.elasticsearch.path_parts.index` attributes to Elasticsearch CLIENT spans. Versions 8.10 and later of the client have native support for OpenTelemetry.
source_path: instrumentation/elasticsearch/elasticsearch-api-client-7.16
scope:
name: io.opentelemetry.elasticsearch-api-client-7.16
target_versions:
javaagent:
- co.elastic.clients:elasticsearch-java:[7.16,7.17.20)
- co.elastic.clients:elasticsearch-java:[8.0.0,8.10)
telemetry:
- when: default
spans:
- span_kind: CLIENT
attributes:
- name: db.elasticsearch.path_parts.id
type: STRING
- name: db.elasticsearch.path_parts.index
type: STRING
- name: db.operation
type: STRING
- name: db.system
type: STRING
- name: http.request.method
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
- name: url.full
type: STRING
- when: otel.semconv-stability.opt-in=database
metrics:
- name: db.client.operation.duration
description: Duration of database client operations.
type: HISTOGRAM
unit: s
attributes:
- name: db.operation.name
type: STRING
- name: db.system.name
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
spans:
- span_kind: CLIENT
attributes:
- name: db.elasticsearch.path_parts.id
type: STRING
- name: db.elasticsearch.path_parts.index
type: STRING
- name: db.operation.name
type: STRING
- name: db.system.name
type: STRING
- name: http.request.method
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
- name: url.full
type: STRING
- name: elasticsearch-rest-5.0
description: This instrumentation enables tracing for Elasticsearch REST clients.
description: This instrumentation enables database CLIENT spans and metrics for
Elasticsearch REST clients.
source_path: instrumentation/elasticsearch/elasticsearch-rest-5.0
scope:
name: io.opentelemetry.elasticsearch-rest-5.0
Expand All @@ -2300,10 +2355,14 @@ libraries:
configurations:
- name: otel.instrumentation.elasticsearch.capture-search-query
description: |
Enable the capture of search query bodies. It is important to note that Elasticsearch queries
may contain personal or sensitive information.
Enable the capture of search query bodies. It is important to note that Elasticsearch queries may contain personal or sensitive information.
type: boolean
default: false
- name: otel.instrumentation.http.known-methods
description: |
Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as `_OTHER`.
type: list
default: CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE
telemetry:
- when: default
spans:
Expand All @@ -2319,8 +2378,35 @@ libraries:
type: LONG
- name: url.full
type: STRING
- when: otel.semconv-stability.opt-in=database
metrics:
- name: db.client.operation.duration
description: Duration of database client operations.
type: HISTOGRAM
unit: s
attributes:
- name: db.system.name
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
spans:
- span_kind: CLIENT
attributes:
- name: db.system.name
type: STRING
- name: http.request.method
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
- name: url.full
type: STRING
- name: elasticsearch-rest-6.4
description: This instrumentation enables tracing for Elasticsearch REST clients.
description: This instrumentation enables database CLIENT spans and metrics for
Elasticsearch REST clients.
source_path: instrumentation/elasticsearch/elasticsearch-rest-6.4
scope:
name: io.opentelemetry.elasticsearch-rest-6.4
Expand All @@ -2333,6 +2419,11 @@ libraries:
Enable the capture of search query bodies. It is important to note that Elasticsearch queries may contain personal or sensitive information.
type: boolean
default: false
- name: otel.instrumentation.http.known-methods
description: |
Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as `_OTHER`.
type: list
default: CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE
telemetry:
- when: default
spans:
Expand All @@ -2348,8 +2439,35 @@ libraries:
type: LONG
- name: url.full
type: STRING
- when: otel.semconv-stability.opt-in=database
metrics:
- name: db.client.operation.duration
description: Duration of database client operations.
type: HISTOGRAM
unit: s
attributes:
- name: db.system.name
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
spans:
- span_kind: CLIENT
attributes:
- name: db.system.name
type: STRING
- name: http.request.method
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
- name: url.full
type: STRING
- name: elasticsearch-rest-7.0
description: This instrumentation enables tracing for Elasticsearch REST clients.
description: This instrumentation enables database CLIENT spans and metrics for
Elasticsearch REST clients.
source_path: instrumentation/elasticsearch/elasticsearch-rest-7.0
scope:
name: io.opentelemetry.elasticsearch-rest-7.0
Expand All @@ -2364,6 +2482,11 @@ libraries:
Enable the capture of search query bodies. It is important to note that Elasticsearch queries may contain personal or sensitive information.
type: boolean
default: false
- name: otel.instrumentation.http.known-methods
description: |
Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as `_OTHER`.
type: list
default: CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE
telemetry:
- when: default
spans:
Expand All @@ -2379,9 +2502,35 @@ libraries:
type: LONG
- name: url.full
type: STRING
- when: otel.semconv-stability.opt-in=database
metrics:
- name: db.client.operation.duration
description: Duration of database client operations.
type: HISTOGRAM
unit: s
attributes:
- name: db.system.name
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
spans:
- span_kind: CLIENT
attributes:
- name: db.system.name
type: STRING
- name: http.request.method
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
- name: url.full
type: STRING
- name: elasticsearch-transport-5.0
description: |
This instrumentation enables client spans for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
This instrumentation enables CLIENT spans and metrics for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
source_path: instrumentation/elasticsearch/elasticsearch-transport-5.0
scope:
name: io.opentelemetry.elasticsearch-transport-5.0
Expand All @@ -2391,9 +2540,15 @@ libraries:
- org.elasticsearch:elasticsearch:[5.0.0,5.3.0)
configurations:
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
description: Enable the capture of experimental span attributes.
description: |
Enable the capture of the experimental span attributes `elasticsearch.action`, `elasticsearch.id`, `elasticsearch.request`, `elasticsearch.request.indices`, `elasticsearch.request.write.routing`, `elasticsearch.request.write.type`, `elasticsearch.response.status`, `elasticsearch.shard.replication.failed`, `elasticsearch.shard.replication.successful`, `elasticsearch.shard.replication.total`, `elasticsearch.type`, and `elasticsearch.version`.
type: boolean
default: false
- name: otel.instrumentation.http.known-methods
description: |
Configures the instrumentation to recognize an alternative set of HTTP request methods. All other methods will be treated as `_OTHER`.
type: list
default: CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,TRACE
telemetry:
- when: default
spans:
Expand Down Expand Up @@ -2442,6 +2597,16 @@ libraries:
- name: network.peer.port
type: LONG
- when: otel.semconv-stability.opt-in=database
metrics:
- name: db.client.operation.duration
description: Duration of database client operations.
type: HISTOGRAM
unit: s
attributes:
- name: db.operation.name
type: STRING
- name: db.system.name
type: STRING
spans:
- span_kind: CLIENT
attributes:
Expand All @@ -2457,7 +2622,7 @@ libraries:
type: LONG
- name: elasticsearch-transport-5.3
description: |
This instrumentation enables client spans for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
This instrumentation enables CLIENT spans and metrics for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
source_path: instrumentation/elasticsearch/elasticsearch-transport-5.3
scope:
name: io.opentelemetry.elasticsearch-transport-5.3
Expand All @@ -2467,7 +2632,8 @@ libraries:
- org.elasticsearch:elasticsearch:[5.3.0,6.0.0)
configurations:
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
description: Enable the capture of experimental span attributes.
description: |
Enable the capture of `elasticsearch.action`, `elasticsearch.id`, `elasticsearch.request`, `elasticsearch.request.indices`, `elasticsearch.request.search.types`, `elasticsearch.request.write.type`, `elasticsearch.request.write.version`, `elasticsearch.response.status`, `elasticsearch.shard.broadcast.failed`, `elasticsearch.shard.broadcast.successful`, `elasticsearch.shard.broadcast.total`, `elasticsearch.shard.replication.failed`, `elasticsearch.shard.replication.successful`, `elasticsearch.shard.replication.total`, `elasticsearch.type`, and `elasticsearch.version` experimental span attributes.
type: boolean
default: false
telemetry:
Expand Down Expand Up @@ -2528,6 +2694,16 @@ libraries:
- name: network.peer.port
type: LONG
- when: otel.semconv-stability.opt-in=database
metrics:
- name: db.client.operation.duration
description: Duration of database client operations.
type: HISTOGRAM
unit: s
attributes:
- name: db.operation.name
type: STRING
- name: db.system.name
type: STRING
spans:
- span_kind: CLIENT
attributes:
Expand All @@ -2543,7 +2719,7 @@ libraries:
type: LONG
- name: elasticsearch-transport-6.0
description: |
This instrumentation enables client spans for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
This instrumentation enables CLIENT spans and metrics for Elasticsearch transport client requests. Each call produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
source_path: instrumentation/elasticsearch/elasticsearch-transport-6.0
scope:
name: io.opentelemetry.elasticsearch-transport-6.0
Expand All @@ -2553,7 +2729,8 @@ libraries:
- org.elasticsearch.client:transport:[6.0.0,)
configurations:
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
description: Enable the capture of experimental span attributes.
description: |
Enable the capture of `elasticsearch.action`, `elasticsearch.id`, `elasticsearch.request`, `elasticsearch.request.indices`, `elasticsearch.request.write.type`, `elasticsearch.request.write.version`, `elasticsearch.response.status`, `elasticsearch.shard.replication.failed`, `elasticsearch.shard.replication.successful`, `elasticsearch.shard.replication.total`, `elasticsearch.type`, and `elasticsearch.version` experimental span attributes.
type: boolean
default: false
telemetry:
Expand Down Expand Up @@ -2610,6 +2787,16 @@ libraries:
- name: network.type
type: STRING
- when: otel.semconv-stability.opt-in=database
metrics:
- name: db.client.operation.duration
description: Duration of database client operations.
type: HISTOGRAM
unit: s
attributes:
- name: db.operation.name
type: STRING
- name: db.system.name
type: STRING
spans:
- span_kind: CLIENT
attributes:
Expand Down
3 changes: 3 additions & 0 deletions instrumentation-docs/instrumentations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ readonly INSTRUMENTATIONS=(
"elasticsearch:elasticsearch-api-client-7.16:javaagent:test"
"elasticsearch:elasticsearch-api-client-7.16:javaagent:testStableSemconv"
"elasticsearch:elasticsearch-rest-7.0:javaagent:test"
"elasticsearch:elasticsearch-rest-7.0:javaagent:testStableSemconv"
"elasticsearch:elasticsearch-transport-5.0:javaagent:test"
"elasticsearch:elasticsearch-transport-5.0:javaagent:testStableSemconv"
"elasticsearch:elasticsearch-transport-5.0:javaagent:testExperimental"
Expand Down Expand Up @@ -139,7 +140,9 @@ readonly INSTRUMENTATIONS=(
readonly COLIMA_INSTRUMENTATIONS=(
"spring:spring-jms:spring-jms-6.0:javaagent:test"
"elasticsearch:elasticsearch-rest-6.4:javaagent:test"
"elasticsearch:elasticsearch-rest-6.4:javaagent:testStableSemconv"
"elasticsearch:elasticsearch-rest-5.0:javaagent:test"
"elasticsearch:elasticsearch-rest-5.0:javaagent:testStableSemconv"
"oracle-ucp-11.2:javaagent:test"
"oracle-ucp-11.2:javaagent:testStableSemconv"
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class TelemetryParser {
// armeria-grpc uses grpc-1.6 instrumenter.
"io.opentelemetry.armeria-grpc-1.14", Set.of("io.opentelemetry.grpc-1.6"),
// couchbase-2.6 extends couchbase-2.0 instrumentation with more attributes.
"io.opentelemetry.couchbase-2.6", Set.of("io.opentelemetry.couchbase-2.0"));
"io.opentelemetry.couchbase-2.6", Set.of("io.opentelemetry.couchbase-2.0"),
// elasticsearch-rest-7.0 extends elasticsearch-api-client-7.16 with more attributes.
"io.opentelemetry.elasticsearch-api-client-7.16",
Set.of("io.opentelemetry.elasticsearch-rest-7.0"));

/**
* Checks if the given telemetry scope is valid for the specified module scope.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package io.opentelemetry.javaagent.instrumentation.elasticsearch.apiclient;

import static io.opentelemetry.instrumentation.testing.GlobalTraceUtil.runWithSpan;
import static io.opentelemetry.instrumentation.testing.junit.db.DbClientMetricsTestUtil.assertDurationMetric;
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
Expand All @@ -16,7 +17,9 @@
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_ELASTICSEARCH_PATH_PARTS;
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION_NAME;
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM_NAME;
import static org.assertj.core.api.Assertions.assertThat;

import co.elastic.clients.elasticsearch.ElasticsearchAsyncClient;
Expand Down Expand Up @@ -154,6 +157,14 @@ void elasticsearchIndex() throws IOException {
URL_FULL,
httpHost.toURI() + "/test-index/_doc/test-id?timeout=10s"),
equalTo(HTTP_RESPONSE_STATUS_CODE, 201L))));

assertDurationMetric(
testing,
"io.opentelemetry.elasticsearch-rest-7.0",
DB_OPERATION_NAME,
DB_SYSTEM_NAME,
SERVER_ADDRESS,
SERVER_PORT);
}

@Test
Expand Down
Loading