Updated Elasticsearch metadata (#14477)
This commit is contained in:
parent
8eba57c840
commit
c7dd76454f
|
|
@ -2278,9 +2278,8 @@ libraries:
|
||||||
attributes: []
|
attributes: []
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
- name: elasticsearch-api-client-7.16
|
- name: elasticsearch-api-client-7.16
|
||||||
description: This instrumentation enables client spans for Elasticsearch API client
|
description: |
|
||||||
requests for version 7 of the client. Versions 8.10 and later have native support
|
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.
|
||||||
for OpenTelemetry.
|
|
||||||
source_path: instrumentation/elasticsearch/elasticsearch-api-client-7.16
|
source_path: instrumentation/elasticsearch/elasticsearch-api-client-7.16
|
||||||
scope:
|
scope:
|
||||||
name: io.opentelemetry.elasticsearch-api-client-7.16
|
name: io.opentelemetry.elasticsearch-api-client-7.16
|
||||||
|
|
@ -2288,8 +2287,64 @@ libraries:
|
||||||
javaagent:
|
javaagent:
|
||||||
- co.elastic.clients:elasticsearch-java:[7.16,7.17.20)
|
- co.elastic.clients:elasticsearch-java:[7.16,7.17.20)
|
||||||
- co.elastic.clients:elasticsearch-java:[8.0.0,8.10)
|
- 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
|
- 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
|
source_path: instrumentation/elasticsearch/elasticsearch-rest-5.0
|
||||||
scope:
|
scope:
|
||||||
name: io.opentelemetry.elasticsearch-rest-5.0
|
name: io.opentelemetry.elasticsearch-rest-5.0
|
||||||
|
|
@ -2300,10 +2355,14 @@ libraries:
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.capture-search-query
|
- name: otel.instrumentation.elasticsearch.capture-search-query
|
||||||
description: |
|
description: |
|
||||||
Enable the capture of search query bodies. It is important to note that Elasticsearch queries
|
Enable the capture of search query bodies. It is important to note that Elasticsearch queries may contain personal or sensitive information.
|
||||||
may contain personal or sensitive information.
|
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
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:
|
telemetry:
|
||||||
- when: default
|
- when: default
|
||||||
spans:
|
spans:
|
||||||
|
|
@ -2319,8 +2378,35 @@ libraries:
|
||||||
type: LONG
|
type: LONG
|
||||||
- name: url.full
|
- name: url.full
|
||||||
type: STRING
|
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
|
- 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
|
source_path: instrumentation/elasticsearch/elasticsearch-rest-6.4
|
||||||
scope:
|
scope:
|
||||||
name: io.opentelemetry.elasticsearch-rest-6.4
|
name: io.opentelemetry.elasticsearch-rest-6.4
|
||||||
|
|
@ -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.
|
Enable the capture of search query bodies. It is important to note that Elasticsearch queries may contain personal or sensitive information.
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
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:
|
telemetry:
|
||||||
- when: default
|
- when: default
|
||||||
spans:
|
spans:
|
||||||
|
|
@ -2348,8 +2439,35 @@ libraries:
|
||||||
type: LONG
|
type: LONG
|
||||||
- name: url.full
|
- name: url.full
|
||||||
type: STRING
|
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
|
- 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
|
source_path: instrumentation/elasticsearch/elasticsearch-rest-7.0
|
||||||
scope:
|
scope:
|
||||||
name: io.opentelemetry.elasticsearch-rest-7.0
|
name: io.opentelemetry.elasticsearch-rest-7.0
|
||||||
|
|
@ -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.
|
Enable the capture of search query bodies. It is important to note that Elasticsearch queries may contain personal or sensitive information.
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
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:
|
telemetry:
|
||||||
- when: default
|
- when: default
|
||||||
spans:
|
spans:
|
||||||
|
|
@ -2379,9 +2502,35 @@ libraries:
|
||||||
type: LONG
|
type: LONG
|
||||||
- name: url.full
|
- name: url.full
|
||||||
type: STRING
|
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
|
- name: elasticsearch-transport-5.0
|
||||||
description: |
|
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
|
source_path: instrumentation/elasticsearch/elasticsearch-transport-5.0
|
||||||
scope:
|
scope:
|
||||||
name: io.opentelemetry.elasticsearch-transport-5.0
|
name: io.opentelemetry.elasticsearch-transport-5.0
|
||||||
|
|
@ -2391,9 +2540,15 @@ libraries:
|
||||||
- org.elasticsearch:elasticsearch:[5.0.0,5.3.0)
|
- org.elasticsearch:elasticsearch:[5.0.0,5.3.0)
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
|
- 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
|
type: boolean
|
||||||
default: false
|
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:
|
telemetry:
|
||||||
- when: default
|
- when: default
|
||||||
spans:
|
spans:
|
||||||
|
|
@ -2442,6 +2597,16 @@ libraries:
|
||||||
- name: network.peer.port
|
- name: network.peer.port
|
||||||
type: LONG
|
type: LONG
|
||||||
- when: otel.semconv-stability.opt-in=database
|
- 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:
|
spans:
|
||||||
- span_kind: CLIENT
|
- span_kind: CLIENT
|
||||||
attributes:
|
attributes:
|
||||||
|
|
@ -2457,7 +2622,7 @@ libraries:
|
||||||
type: LONG
|
type: LONG
|
||||||
- name: elasticsearch-transport-5.3
|
- name: elasticsearch-transport-5.3
|
||||||
description: |
|
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
|
source_path: instrumentation/elasticsearch/elasticsearch-transport-5.3
|
||||||
scope:
|
scope:
|
||||||
name: io.opentelemetry.elasticsearch-transport-5.3
|
name: io.opentelemetry.elasticsearch-transport-5.3
|
||||||
|
|
@ -2467,7 +2632,8 @@ libraries:
|
||||||
- org.elasticsearch:elasticsearch:[5.3.0,6.0.0)
|
- org.elasticsearch:elasticsearch:[5.3.0,6.0.0)
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
|
- 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
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
telemetry:
|
telemetry:
|
||||||
|
|
@ -2528,6 +2694,16 @@ libraries:
|
||||||
- name: network.peer.port
|
- name: network.peer.port
|
||||||
type: LONG
|
type: LONG
|
||||||
- when: otel.semconv-stability.opt-in=database
|
- 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:
|
spans:
|
||||||
- span_kind: CLIENT
|
- span_kind: CLIENT
|
||||||
attributes:
|
attributes:
|
||||||
|
|
@ -2543,7 +2719,7 @@ libraries:
|
||||||
type: LONG
|
type: LONG
|
||||||
- name: elasticsearch-transport-6.0
|
- name: elasticsearch-transport-6.0
|
||||||
description: |
|
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
|
source_path: instrumentation/elasticsearch/elasticsearch-transport-6.0
|
||||||
scope:
|
scope:
|
||||||
name: io.opentelemetry.elasticsearch-transport-6.0
|
name: io.opentelemetry.elasticsearch-transport-6.0
|
||||||
|
|
@ -2553,7 +2729,8 @@ libraries:
|
||||||
- org.elasticsearch.client:transport:[6.0.0,)
|
- org.elasticsearch.client:transport:[6.0.0,)
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
|
- 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
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
telemetry:
|
telemetry:
|
||||||
|
|
@ -2610,6 +2787,16 @@ libraries:
|
||||||
- name: network.type
|
- name: network.type
|
||||||
type: STRING
|
type: STRING
|
||||||
- when: otel.semconv-stability.opt-in=database
|
- 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:
|
spans:
|
||||||
- span_kind: CLIENT
|
- span_kind: CLIENT
|
||||||
attributes:
|
attributes:
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ readonly INSTRUMENTATIONS=(
|
||||||
"elasticsearch:elasticsearch-api-client-7.16:javaagent:test"
|
"elasticsearch:elasticsearch-api-client-7.16:javaagent:test"
|
||||||
"elasticsearch:elasticsearch-api-client-7.16:javaagent:testStableSemconv"
|
"elasticsearch:elasticsearch-api-client-7.16:javaagent:testStableSemconv"
|
||||||
"elasticsearch:elasticsearch-rest-7.0:javaagent:test"
|
"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:test"
|
||||||
"elasticsearch:elasticsearch-transport-5.0:javaagent:testStableSemconv"
|
"elasticsearch:elasticsearch-transport-5.0:javaagent:testStableSemconv"
|
||||||
"elasticsearch:elasticsearch-transport-5.0:javaagent:testExperimental"
|
"elasticsearch:elasticsearch-transport-5.0:javaagent:testExperimental"
|
||||||
|
|
@ -139,7 +140,9 @@ readonly INSTRUMENTATIONS=(
|
||||||
readonly COLIMA_INSTRUMENTATIONS=(
|
readonly COLIMA_INSTRUMENTATIONS=(
|
||||||
"spring:spring-jms:spring-jms-6.0:javaagent:test"
|
"spring:spring-jms:spring-jms-6.0:javaagent:test"
|
||||||
"elasticsearch:elasticsearch-rest-6.4: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:test"
|
||||||
|
"elasticsearch:elasticsearch-rest-5.0:javaagent:testStableSemconv"
|
||||||
"oracle-ucp-11.2:javaagent:test"
|
"oracle-ucp-11.2:javaagent:test"
|
||||||
"oracle-ucp-11.2:javaagent:testStableSemconv"
|
"oracle-ucp-11.2:javaagent:testStableSemconv"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,10 @@ class TelemetryParser {
|
||||||
// armeria-grpc uses grpc-1.6 instrumenter.
|
// armeria-grpc uses grpc-1.6 instrumenter.
|
||||||
"io.opentelemetry.armeria-grpc-1.14", Set.of("io.opentelemetry.grpc-1.6"),
|
"io.opentelemetry.armeria-grpc-1.14", Set.of("io.opentelemetry.grpc-1.6"),
|
||||||
// couchbase-2.6 extends couchbase-2.0 instrumentation with more attributes.
|
// 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.
|
* Checks if the given telemetry scope is valid for the specified module scope.
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
package io.opentelemetry.javaagent.instrumentation.elasticsearch.apiclient;
|
package io.opentelemetry.javaagent.instrumentation.elasticsearch.apiclient;
|
||||||
|
|
||||||
import static io.opentelemetry.instrumentation.testing.GlobalTraceUtil.runWithSpan;
|
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.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
|
||||||
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
||||||
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
|
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
|
||||||
|
|
@ -16,7 +17,9 @@ import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
|
||||||
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
|
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_ELASTICSEARCH_PATH_PARTS;
|
||||||
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
|
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;
|
||||||
|
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM_NAME;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import co.elastic.clients.elasticsearch.ElasticsearchAsyncClient;
|
import co.elastic.clients.elasticsearch.ElasticsearchAsyncClient;
|
||||||
|
|
@ -154,6 +157,14 @@ class ElasticsearchClientTest {
|
||||||
URL_FULL,
|
URL_FULL,
|
||||||
httpHost.toURI() + "/test-index/_doc/test-id?timeout=10s"),
|
httpHost.toURI() + "/test-index/_doc/test-id?timeout=10s"),
|
||||||
equalTo(HTTP_RESPONSE_STATUS_CODE, 201L))));
|
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
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,5 @@
|
||||||
description: This instrumentation enables client spans for Elasticsearch API client requests for
|
description: >
|
||||||
version 7 of the client. Versions 8.10 and later have native support for OpenTelemetry.
|
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.
|
||||||
|
|
|
||||||
|
|
@ -42,4 +42,13 @@ tasks {
|
||||||
|
|
||||||
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
|
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val testStableSemconv by registering(Test::class) {
|
||||||
|
jvmArgs("-Dotel.semconv-stability.opt-in=database")
|
||||||
|
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database")
|
||||||
|
}
|
||||||
|
|
||||||
|
check {
|
||||||
|
dependsOn(testStableSemconv)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
package io.opentelemetry.javaagent.instrumentation.elasticsearch.rest.v5_0;
|
package io.opentelemetry.javaagent.instrumentation.elasticsearch.rest.v5_0;
|
||||||
|
|
||||||
|
import static io.opentelemetry.instrumentation.testing.junit.db.DbClientMetricsTestUtil.assertDurationMetric;
|
||||||
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
|
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
|
||||||
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
||||||
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
|
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
|
||||||
|
|
@ -14,6 +15,7 @@ import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
|
||||||
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
|
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
|
||||||
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
|
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
|
||||||
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
|
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 static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
@ -115,6 +117,13 @@ class ElasticsearchRest5Test {
|
||||||
equalTo(NETWORK_PROTOCOL_VERSION, "1.1"),
|
equalTo(NETWORK_PROTOCOL_VERSION, "1.1"),
|
||||||
equalTo(URL_FULL, httpHost.toURI() + "/_cluster/health"),
|
equalTo(URL_FULL, httpHost.toURI() + "/_cluster/health"),
|
||||||
equalTo(HTTP_RESPONSE_STATUS_CODE, 200))));
|
equalTo(HTTP_RESPONSE_STATUS_CODE, 200))));
|
||||||
|
|
||||||
|
assertDurationMetric(
|
||||||
|
testing,
|
||||||
|
"io.opentelemetry.elasticsearch-rest-5.0",
|
||||||
|
DB_SYSTEM_NAME,
|
||||||
|
SERVER_ADDRESS,
|
||||||
|
SERVER_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
description: This instrumentation enables tracing for Elasticsearch REST clients.
|
description: This instrumentation enables database CLIENT spans and metrics for Elasticsearch REST clients.
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.capture-search-query
|
- name: otel.instrumentation.elasticsearch.capture-search-query
|
||||||
description: |
|
description: >
|
||||||
Enable the capture of search query bodies. It is important to note that Elasticsearch queries
|
Enable the capture of search query bodies. It is important to note that Elasticsearch queries
|
||||||
may contain personal or sensitive information.
|
may contain personal or sensitive information.
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
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"
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,17 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
test {
|
withType<Test>().configureEach {
|
||||||
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
|
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
|
||||||
|
|
||||||
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
|
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val testStableSemconv by registering(Test::class) {
|
||||||
|
jvmArgs("-Dotel.semconv-stability.opt-in=database")
|
||||||
|
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database")
|
||||||
|
}
|
||||||
|
|
||||||
|
check {
|
||||||
|
dependsOn(testStableSemconv)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
package io.opentelemetry.javaagent.instrumentation.elasticsearch.rest.v6_4;
|
package io.opentelemetry.javaagent.instrumentation.elasticsearch.rest.v6_4;
|
||||||
|
|
||||||
|
import static io.opentelemetry.instrumentation.testing.junit.db.DbClientMetricsTestUtil.assertDurationMetric;
|
||||||
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
|
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
|
||||||
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
||||||
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
|
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
|
||||||
|
|
@ -14,6 +15,7 @@ import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
|
||||||
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
|
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
|
||||||
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
|
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
|
||||||
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
|
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 static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
@ -82,30 +84,36 @@ class ElasticsearchRest6Test {
|
||||||
assertThat(result.get("status")).isEqualTo("green");
|
assertThat(result.get("status")).isEqualTo("green");
|
||||||
|
|
||||||
testing.waitAndAssertTraces(
|
testing.waitAndAssertTraces(
|
||||||
trace -> {
|
trace ->
|
||||||
trace.hasSpansSatisfyingExactly(
|
trace.hasSpansSatisfyingExactly(
|
||||||
span ->
|
span ->
|
||||||
span.hasName("GET")
|
span.hasName("GET")
|
||||||
.hasKind(SpanKind.CLIENT)
|
.hasKind(SpanKind.CLIENT)
|
||||||
.hasNoParent()
|
.hasNoParent()
|
||||||
.hasAttributesSatisfyingExactly(
|
.hasAttributesSatisfyingExactly(
|
||||||
equalTo(maybeStable(DB_SYSTEM), "elasticsearch"),
|
equalTo(maybeStable(DB_SYSTEM), "elasticsearch"),
|
||||||
equalTo(HTTP_REQUEST_METHOD, "GET"),
|
equalTo(HTTP_REQUEST_METHOD, "GET"),
|
||||||
equalTo(SERVER_ADDRESS, httpHost.getHostName()),
|
equalTo(SERVER_ADDRESS, httpHost.getHostName()),
|
||||||
equalTo(SERVER_PORT, httpHost.getPort()),
|
equalTo(SERVER_PORT, httpHost.getPort()),
|
||||||
equalTo(URL_FULL, httpHost.toURI() + "/_cluster/health")),
|
equalTo(URL_FULL, httpHost.toURI() + "/_cluster/health")),
|
||||||
span ->
|
span ->
|
||||||
span.hasName("GET")
|
span.hasName("GET")
|
||||||
.hasKind(SpanKind.CLIENT)
|
.hasKind(SpanKind.CLIENT)
|
||||||
.hasParent(trace.getSpan(0))
|
.hasParent(trace.getSpan(0))
|
||||||
.hasAttributesSatisfyingExactly(
|
.hasAttributesSatisfyingExactly(
|
||||||
equalTo(SERVER_ADDRESS, httpHost.getHostName()),
|
equalTo(SERVER_ADDRESS, httpHost.getHostName()),
|
||||||
equalTo(SERVER_PORT, httpHost.getPort()),
|
equalTo(SERVER_PORT, httpHost.getPort()),
|
||||||
equalTo(HTTP_REQUEST_METHOD, "GET"),
|
equalTo(HTTP_REQUEST_METHOD, "GET"),
|
||||||
equalTo(NETWORK_PROTOCOL_VERSION, "1.1"),
|
equalTo(NETWORK_PROTOCOL_VERSION, "1.1"),
|
||||||
equalTo(URL_FULL, httpHost.toURI() + "/_cluster/health"),
|
equalTo(URL_FULL, httpHost.toURI() + "/_cluster/health"),
|
||||||
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L)));
|
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L))));
|
||||||
});
|
|
||||||
|
assertDurationMetric(
|
||||||
|
testing,
|
||||||
|
"io.opentelemetry.elasticsearch-rest-6.4",
|
||||||
|
DB_SYSTEM_NAME,
|
||||||
|
SERVER_ADDRESS,
|
||||||
|
SERVER_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -138,10 +146,7 @@ class ElasticsearchRest6Test {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
testing.runWithSpan(
|
testing.runWithSpan(
|
||||||
"parent",
|
"parent", () -> client.performRequestAsync("GET", "_cluster/health", responseListener));
|
||||||
() -> {
|
|
||||||
client.performRequestAsync("GET", "_cluster/health", responseListener);
|
|
||||||
});
|
|
||||||
countDownLatch.await();
|
countDownLatch.await();
|
||||||
|
|
||||||
if (exception[0] != null) {
|
if (exception[0] != null) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
description: This instrumentation enables tracing for Elasticsearch REST clients.
|
description: This instrumentation enables database CLIENT spans and metrics for Elasticsearch REST clients.
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.capture-search-query
|
- name: otel.instrumentation.elasticsearch.capture-search-query
|
||||||
description: >
|
description: >
|
||||||
|
|
@ -6,3 +6,9 @@ configurations:
|
||||||
may contain personal or sensitive information.
|
may contain personal or sensitive information.
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
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"
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,19 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
test {
|
withType<Test>().configureEach {
|
||||||
|
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
|
||||||
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
|
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
|
||||||
|
|
||||||
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
|
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val testStableSemconv by registering(Test::class) {
|
||||||
|
jvmArgs("-Dotel.semconv-stability.opt-in=database")
|
||||||
|
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database")
|
||||||
|
}
|
||||||
|
|
||||||
|
check {
|
||||||
|
dependsOn(testStableSemconv)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
package io.opentelemetry.javaagent.instrumentation.elasticsearch.rest.v7_0;
|
package io.opentelemetry.javaagent.instrumentation.elasticsearch.rest.v7_0;
|
||||||
|
|
||||||
import static io.opentelemetry.instrumentation.testing.GlobalTraceUtil.runWithSpan;
|
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.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
|
||||||
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
||||||
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
|
import static io.opentelemetry.semconv.HttpAttributes.HTTP_REQUEST_METHOD;
|
||||||
|
|
@ -15,6 +16,7 @@ import static io.opentelemetry.semconv.ServerAttributes.SERVER_ADDRESS;
|
||||||
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
|
import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT;
|
||||||
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
|
import static io.opentelemetry.semconv.UrlAttributes.URL_FULL;
|
||||||
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
|
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 static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import io.opentelemetry.api.trace.SpanKind;
|
import io.opentelemetry.api.trace.SpanKind;
|
||||||
|
|
@ -106,6 +108,13 @@ class ElasticsearchRest7Test {
|
||||||
equalTo(NETWORK_PROTOCOL_VERSION, "1.1"),
|
equalTo(NETWORK_PROTOCOL_VERSION, "1.1"),
|
||||||
equalTo(URL_FULL, httpHost.toURI() + "/_cluster/health"),
|
equalTo(URL_FULL, httpHost.toURI() + "/_cluster/health"),
|
||||||
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L))));
|
equalTo(HTTP_RESPONSE_STATUS_CODE, 200L))));
|
||||||
|
|
||||||
|
assertDurationMetric(
|
||||||
|
testing,
|
||||||
|
"io.opentelemetry.elasticsearch-rest-7.0",
|
||||||
|
DB_SYSTEM_NAME,
|
||||||
|
SERVER_ADDRESS,
|
||||||
|
SERVER_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
description: This instrumentation enables tracing for Elasticsearch REST clients.
|
description: This instrumentation enables database CLIENT spans and metrics for Elasticsearch REST clients.
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.capture-search-query
|
- name: otel.instrumentation.elasticsearch.capture-search-query
|
||||||
description: >
|
description: >
|
||||||
|
|
@ -6,3 +6,9 @@ configurations:
|
||||||
may contain personal or sensitive information.
|
may contain personal or sensitive information.
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
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"
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import org.elasticsearch.node.internal.InternalSettingsPreparer;
|
||||||
import org.elasticsearch.transport.Netty3Plugin;
|
import org.elasticsearch.transport.Netty3Plugin;
|
||||||
import org.junit.jupiter.api.AfterAll;
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.io.TempDir;
|
import org.junit.jupiter.api.io.TempDir;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
@ -82,4 +83,9 @@ class Elasticsearch5NodeClientTest extends AbstractElasticsearchNodeClientTest {
|
||||||
protected boolean hasWriteVersion() {
|
protected boolean hasWriteVersion() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testDurationMetric() throws Exception {
|
||||||
|
metricAssertion("io.opentelemetry.elasticsearch-transport-5.0");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,21 @@
|
||||||
description: >
|
description: >
|
||||||
This instrumentation enables client spans for Elasticsearch transport client requests. Each call
|
This instrumentation enables CLIENT spans and metrics for Elasticsearch transport client requests.
|
||||||
produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
|
Each call produces a span named after the Elasticsearch action, enriched with transport-specific
|
||||||
|
attributes.
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
|
- 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
|
type: boolean
|
||||||
default: false
|
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"
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import org.elasticsearch.node.Node;
|
||||||
import org.elasticsearch.transport.Netty3Plugin;
|
import org.elasticsearch.transport.Netty3Plugin;
|
||||||
import org.junit.jupiter.api.AfterAll;
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.io.TempDir;
|
import org.junit.jupiter.api.io.TempDir;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
@ -89,4 +90,9 @@ class Elasticsearch53NodeClientTest extends AbstractElasticsearchNodeClientTest
|
||||||
public Client client() {
|
public Client client() {
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testDurationMetric() throws Exception {
|
||||||
|
metricAssertion("io.opentelemetry.elasticsearch-transport-5.3");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,17 @@
|
||||||
description: >
|
description: >
|
||||||
This instrumentation enables client spans for Elasticsearch transport client requests. Each call
|
This instrumentation enables CLIENT spans and metrics for Elasticsearch transport client requests.
|
||||||
produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
|
Each call produces a span named after the Elasticsearch action, enriched with transport-specific
|
||||||
|
attributes.
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
|
- 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
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,15 @@
|
||||||
description: >
|
description: >
|
||||||
This instrumentation enables client spans for Elasticsearch transport client requests. Each call
|
This instrumentation enables CLIENT spans and metrics for Elasticsearch transport client requests.
|
||||||
produces a span named after the Elasticsearch action, enriched with transport-specific attributes.
|
Each call produces a span named after the Elasticsearch action, enriched with transport-specific
|
||||||
|
attributes.
|
||||||
configurations:
|
configurations:
|
||||||
- name: otel.instrumentation.elasticsearch.experimental-span-attributes
|
- 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
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.node.Node;
|
import org.elasticsearch.node.Node;
|
||||||
import org.junit.jupiter.api.AfterAll;
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.io.TempDir;
|
import org.junit.jupiter.api.io.TempDir;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
@ -98,4 +99,9 @@ public abstract class AbstractElasticsearch6NodeClientTest
|
||||||
.execute()
|
.execute()
|
||||||
.actionGet(TIMEOUT);
|
.actionGet(TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testDurationMetric() throws Exception {
|
||||||
|
metricAssertion("io.opentelemetry.elasticsearch-transport-6.0");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,11 @@ package io.opentelemetry.javaagent.instrumentation.elasticsearch.transport;
|
||||||
|
|
||||||
import static io.opentelemetry.api.common.AttributeKey.longKey;
|
import static io.opentelemetry.api.common.AttributeKey.longKey;
|
||||||
import static io.opentelemetry.api.common.AttributeKey.stringKey;
|
import static io.opentelemetry.api.common.AttributeKey.stringKey;
|
||||||
|
import static io.opentelemetry.instrumentation.testing.junit.db.DbClientMetricsTestUtil.assertDurationMetric;
|
||||||
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
|
import static io.opentelemetry.instrumentation.testing.junit.db.SemconvStabilityUtil.maybeStable;
|
||||||
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
|
||||||
|
import static io.opentelemetry.semconv.DbAttributes.DB_OPERATION_NAME;
|
||||||
|
import static io.opentelemetry.semconv.DbAttributes.DB_SYSTEM_NAME;
|
||||||
import static io.opentelemetry.semconv.ErrorAttributes.ERROR_TYPE;
|
import static io.opentelemetry.semconv.ErrorAttributes.ERROR_TYPE;
|
||||||
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
|
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
|
||||||
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
|
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
|
||||||
|
|
@ -276,4 +279,14 @@ public abstract class AbstractElasticsearchNodeClientTest extends AbstractElasti
|
||||||
protected boolean hasWriteVersion() {
|
protected boolean hasWriteVersion() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void metricAssertion(String instrumentationName) throws Exception {
|
||||||
|
ClusterHealthStatus clusterHealthStatus =
|
||||||
|
testing.runWithSpan("parent", this::clusterHealthSync);
|
||||||
|
|
||||||
|
assertThat(clusterHealthStatus.name()).isEqualTo("GREEN");
|
||||||
|
testing.waitForTraces(1);
|
||||||
|
|
||||||
|
assertDurationMetric(testing, instrumentationName, DB_SYSTEM_NAME, DB_OPERATION_NAME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue