diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index dbdbeb5b44cc..0761a72a0374 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -5841,28 +5841,234 @@ libraries: default: false jedis: - name: jedis-1.4 + description: This instrumentation enables database client spans and database client + metrics for Jedis Redis operations. + semantic_conventions: + - DATABASE_CLIENT_SPANS + - DATABASE_CLIENT_METRICS + library_link: https://github.com/redis/jedis source_path: instrumentation/jedis/jedis-1.4 scope: name: io.opentelemetry.jedis-1.4 target_versions: javaagent: - redis.clients:jedis:[1.4.0,3.0.0) + configurations: + - name: otel.instrumentation.common.db-statement-sanitizer.enabled + description: Enables statement sanitization for database queries. + type: boolean + default: true + - name: otel.instrumentation.common.peer-service-mapping + description: Used to specify a mapping from host names or IP addresses to peer + services. + type: map + default: '' + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + type: STRING + - name: db.statement + type: STRING + - name: db.system + type: STRING + - name: peer.service + type: STRING + - name: server.address + type: STRING + - name: server.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 + - name: server.address + type: STRING + - name: server.port + type: LONG + spans: + - span_kind: CLIENT + attributes: + - name: db.operation.name + type: STRING + - name: db.query.text + type: STRING + - name: db.system.name + type: STRING + - name: peer.service + type: STRING + - name: server.address + type: STRING + - name: server.port + type: LONG - name: jedis-3.0 + description: This instrumentation enables database client spans and database client + metrics for Jedis Redis operations. + semantic_conventions: + - DATABASE_CLIENT_SPANS + - DATABASE_CLIENT_METRICS + library_link: https://github.com/redis/jedis source_path: instrumentation/jedis/jedis-3.0 scope: name: io.opentelemetry.jedis-3.0 target_versions: javaagent: - redis.clients:jedis:[3.0.0,4) + configurations: + - name: otel.instrumentation.common.db-statement-sanitizer.enabled + description: Enables statement sanitization for database queries. + type: boolean + default: true + - name: otel.instrumentation.common.peer-service-mapping + description: Used to specify a mapping from host names or IP addresses to peer + services. + type: map + default: '' + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + type: STRING + - name: db.statement + type: STRING + - name: db.system + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: network.type + type: STRING + - name: peer.service + type: STRING + - name: server.address + type: STRING + - name: server.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 + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: server.address + type: STRING + - name: server.port + type: LONG + spans: + - span_kind: CLIENT + attributes: + - name: db.operation.name + type: STRING + - name: db.query.text + type: STRING + - name: db.system.name + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: network.type + type: STRING + - name: peer.service + type: STRING + - name: server.address + type: STRING + - name: server.port + type: LONG - name: jedis-4.0 + description: This instrumentation enables database client spans and database client + metrics for Jedis Redis operations. + semantic_conventions: + - DATABASE_CLIENT_SPANS + - DATABASE_CLIENT_METRICS + library_link: https://github.com/redis/jedis source_path: instrumentation/jedis/jedis-4.0 scope: name: io.opentelemetry.jedis-4.0 target_versions: javaagent: - redis.clients:jedis:[4.0.0-beta1,) + configurations: + - name: otel.instrumentation.common.db-statement-sanitizer.enabled + description: Enables statement sanitization for database queries. + type: boolean + default: true + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + type: STRING + - name: db.statement + type: STRING + - name: db.system + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - 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 + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + spans: + - span_kind: CLIENT + attributes: + - name: db.operation.name + type: STRING + - name: db.query.text + type: STRING + - name: db.system.name + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: network.type + type: STRING jetty: - name: jetty-11.0 + description: This instrumentation enables HTTP server spans and HTTP server metrics + for Jetty. + semantic_conventions: + - HTTP_SERVER_SPANS + - HTTP_SERVER_METRICS + library_link: https://eclipse.dev/jetty/ source_path: instrumentation/jetty/jetty-11.0 minimum_java_version: 11 scope: @@ -5870,7 +6076,79 @@ libraries: target_versions: javaagent: - org.eclipse.jetty:jetty-server:[11, 12) + configurations: + - 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 + - name: otel.instrumentation.http.server.capture-request-headers + description: List of HTTP request headers to capture in HTTP server telemetry. + type: list + default: '' + - name: otel.instrumentation.http.server.capture-response-headers + description: List of HTTP response headers to capture in HTTP server telemetry. + type: list + default: '' + - name: otel.instrumentation.http.server.emit-experimental-telemetry + description: | + Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size` and `http.response.body.size` attributes to spans, and records `http.server.request.size` and `http.server.response.size` metrics. + type: boolean + default: false + telemetry: + - when: default + metrics: + - name: http.server.request.duration + description: Duration of HTTP server requests. + type: HISTOGRAM + unit: s + attributes: + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: network.protocol.version + type: STRING + - name: url.scheme + type: STRING + spans: + - span_kind: SERVER + attributes: + - name: client.address + type: STRING + - name: error.type + type: STRING + - name: http.request.method + type: STRING + - name: http.request.method_original + type: STRING + - name: http.response.status_code + type: LONG + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: network.protocol.version + type: STRING + - name: server.address + type: STRING + - name: server.port + type: LONG + - name: url.path + type: STRING + - name: url.query + type: STRING + - name: url.scheme + type: STRING + - name: user_agent.original + type: STRING - name: jetty-12.0 + description: This instrumentation enables HTTP server spans and HTTP server metrics + for Jetty. + semantic_conventions: + - HTTP_SERVER_SPANS + - HTTP_SERVER_METRICS + library_link: https://eclipse.dev/jetty/ source_path: instrumentation/jetty/jetty-12.0 minimum_java_version: 17 scope: @@ -5878,14 +6156,160 @@ libraries: target_versions: javaagent: - org.eclipse.jetty:jetty-server:[12,) + configurations: + - 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 + - name: otel.instrumentation.http.server.capture-request-headers + description: List of HTTP request headers to capture in HTTP server telemetry. + type: list + default: '' + - name: otel.instrumentation.http.server.capture-response-headers + description: List of HTTP response headers to capture in HTTP server telemetry. + type: list + default: '' + - name: otel.instrumentation.http.server.emit-experimental-telemetry + description: | + Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size` and `http.response.body.size` attributes to spans, and records `http.server.request.size` and `http.server.response.size` metrics. + type: boolean + default: false + telemetry: + - when: default + metrics: + - name: http.server.request.duration + description: Duration of HTTP server requests. + type: HISTOGRAM + unit: s + attributes: + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: network.protocol.version + type: STRING + - name: url.scheme + type: STRING + spans: + - span_kind: SERVER + attributes: + - name: client.address + type: STRING + - name: error.type + type: STRING + - name: http.request.method + type: STRING + - name: http.request.method_original + type: STRING + - name: http.response.status_code + type: LONG + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: network.protocol.version + type: STRING + - name: server.address + type: STRING + - name: server.port + type: LONG + - name: url.path + type: STRING + - name: url.query + type: STRING + - name: url.scheme + type: STRING + - name: user_agent.original + type: STRING - name: jetty-8.0 + description: This instrumentation enables HTTP server spans and HTTP server metrics + for Jetty. + semantic_conventions: + - HTTP_SERVER_SPANS + - HTTP_SERVER_METRICS + library_link: https://eclipse.dev/jetty/ + features: + - CONTEXT_PROPAGATION source_path: instrumentation/jetty/jetty-8.0 scope: name: io.opentelemetry.jetty-8.0 target_versions: javaagent: - org.eclipse.jetty:jetty-server:[8.0.0.v20110901,11) + configurations: + - 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 + - name: otel.instrumentation.http.server.capture-request-headers + description: List of HTTP request headers to capture in HTTP server telemetry. + type: list + default: '' + - name: otel.instrumentation.http.server.capture-response-headers + description: List of HTTP response headers to capture in HTTP server telemetry. + type: list + default: '' + - name: otel.instrumentation.http.server.emit-experimental-telemetry + description: | + Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size` and `http.response.body.size` attributes to spans, and records `http.server.request.size` and `http.server.response.size` metrics. + type: boolean + default: false + telemetry: + - when: default + metrics: + - name: http.server.request.duration + description: Duration of HTTP server requests. + type: HISTOGRAM + unit: s + attributes: + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: network.protocol.version + type: STRING + - name: url.scheme + type: STRING + spans: + - span_kind: SERVER + attributes: + - name: client.address + type: STRING + - name: error.type + type: STRING + - name: http.request.method + type: STRING + - name: http.request.method_original + type: STRING + - name: http.response.status_code + type: LONG + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: network.protocol.version + type: STRING + - name: server.address + type: STRING + - name: server.port + type: LONG + - name: url.path + type: STRING + - name: url.query + type: STRING + - name: url.scheme + type: STRING + - name: user_agent.original + type: STRING - name: jetty-httpclient-12.0 + description: This instrumentation enables HTTP client spans and HTTP client metrics + for Jetty HTTP Client. + semantic_conventions: + - HTTP_CLIENT_SPANS + - HTTP_CLIENT_METRICS + library_link: https://eclipse.dev/jetty/ source_path: instrumentation/jetty-httpclient/jetty-httpclient-12.0 minimum_java_version: 17 scope: @@ -5895,6 +6319,34 @@ libraries: - org.eclipse.jetty:jetty-client:[12,) library: - org.eclipse.jetty:jetty-client:12.0.0 + configurations: + - 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 + - name: otel.instrumentation.http.client.capture-request-headers + description: List of HTTP request headers to capture in HTTP client telemetry. + type: list + default: '' + - name: otel.instrumentation.http.client.capture-response-headers + description: List of HTTP response headers to capture in HTTP client telemetry. + type: list + default: '' + - name: otel.instrumentation.common.peer-service-mapping + description: Used to specify a mapping from host names or IP addresses to peer + services. + type: map + default: '' + - name: otel.instrumentation.http.client.emit-experimental-telemetry + description: | + Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size` and `http.response.body.size` attributes to spans, and records `http.client.request.size` and `http.client.response.size` metrics. + type: boolean + default: false + - name: otel.instrumentation.http.client.experimental.redact-query-parameters + description: Redact sensitive URL parameters. See https://opentelemetry.io/docs/specs/semconv/http/http-spans. + type: boolean + default: true telemetry: - when: default metrics: @@ -5935,6 +6387,12 @@ libraries: - name: url.full type: STRING - name: jetty-httpclient-9.2 + description: This instrumentation enables HTTP client spans and HTTP client metrics + for Jetty HTTP Client. + semantic_conventions: + - HTTP_CLIENT_SPANS + - HTTP_CLIENT_METRICS + library_link: https://eclipse.dev/jetty/ source_path: instrumentation/jetty-httpclient/jetty-httpclient-9.2 scope: name: io.opentelemetry.jetty-httpclient-9.2 @@ -5943,6 +6401,34 @@ libraries: - org.eclipse.jetty:jetty-client:[9.2,10) library: - org.eclipse.jetty:jetty-client:[9.2.0.v20140526,9.+) + configurations: + - 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 + - name: otel.instrumentation.http.client.capture-request-headers + description: List of HTTP request headers to capture in HTTP client telemetry. + type: list + default: '' + - name: otel.instrumentation.http.client.capture-response-headers + description: List of HTTP response headers to capture in HTTP client telemetry. + type: list + default: '' + - name: otel.instrumentation.common.peer-service-mapping + description: Used to specify a mapping from host names or IP addresses to peer + services. + type: map + default: '' + - name: otel.instrumentation.http.client.emit-experimental-telemetry + description: | + Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size` and `http.response.body.size` attributes to spans, and records `http.client.request.size` and `http.client.response.size` metrics. + type: boolean + default: false + - name: otel.instrumentation.http.client.experimental.redact-query-parameters + description: Redact sensitive URL parameters. See https://opentelemetry.io/docs/specs/semconv/http/http-spans. + type: boolean + default: true telemetry: - when: default metrics: diff --git a/instrumentation-docs/instrumentations.sh b/instrumentation-docs/instrumentations.sh index 5b1cd86e9383..89668cb3f00b 100755 --- a/instrumentation-docs/instrumentations.sh +++ b/instrumentation-docs/instrumentations.sh @@ -128,6 +128,15 @@ readonly INSTRUMENTATIONS=( "jaxws:jaxws-cxf-3.0:javaagent:test" "jaxws:jaxws-jws-api-1.1:javaagent:test" "jaxws:jaxws-metro-2.2:javaagent:test" + "jedis:jedis-1.4:javaagent:test" + "jedis:jedis-1.4:javaagent:testStableSemconv" + "jedis:jedis-3.0:javaagent:test" + "jedis:jedis-3.0:javaagent:testStableSemconv" + "jedis:jedis-4.0:javaagent:test" + "jedis:jedis-4.0:javaagent:testStableSemconv" + "jetty:jetty-8.0:javaagent:test" + "jetty:jetty-11.0:javaagent:test" + "jetty:jetty-12.0:javaagent:test" "jetty-httpclient:jetty-httpclient-12.0:javaagent:test" "jetty-httpclient:jetty-httpclient-9.2:javaagent:test" "jodd-http-4.2:javaagent:test" diff --git a/instrumentation/jedis/jedis-1.4/javaagent/build.gradle.kts b/instrumentation/jedis/jedis-1.4/javaagent/build.gradle.kts index 8fc19ca3fe50..27d1a46e7306 100644 --- a/instrumentation/jedis/jedis-1.4/javaagent/build.gradle.kts +++ b/instrumentation/jedis/jedis-1.4/javaagent/build.gradle.kts @@ -41,6 +41,7 @@ testing { tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } val testStableSemconv by registering(Test::class) { @@ -48,6 +49,7 @@ tasks { classpath = sourceSets.test.get().runtimeClasspath jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") } check { diff --git a/instrumentation/jedis/jedis-1.4/metadata.yaml b/instrumentation/jedis/jedis-1.4/metadata.yaml new file mode 100644 index 000000000000..5c5305bf31de --- /dev/null +++ b/instrumentation/jedis/jedis-1.4/metadata.yaml @@ -0,0 +1,14 @@ +description: This instrumentation enables database client spans and database client metrics for Jedis Redis operations. +semantic_conventions: + - DATABASE_CLIENT_SPANS + - DATABASE_CLIENT_METRICS +library_link: https://github.com/redis/jedis +configurations: + - name: otel.instrumentation.common.db-statement-sanitizer.enabled + description: Enables statement sanitization for database queries. + type: boolean + default: true + - name: otel.instrumentation.common.peer-service-mapping + description: Used to specify a mapping from host names or IP addresses to peer services. + type: map + default: "" diff --git a/instrumentation/jedis/jedis-1.4/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/AbstractJedisTest.java b/instrumentation/jedis/jedis-1.4/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/AbstractJedisTest.java index 40e0d93e60fe..f5db1d8c3299 100644 --- a/instrumentation/jedis/jedis-1.4/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/AbstractJedisTest.java +++ b/instrumentation/jedis/jedis-1.4/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/AbstractJedisTest.java @@ -5,13 +5,16 @@ package io.opentelemetry.javaagent.instrumentation.jedis; +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.ServerAttributes.SERVER_ADDRESS; import static io.opentelemetry.semconv.ServerAttributes.SERVER_PORT; 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_STATEMENT; import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM; +import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM_NAME; import static io.opentelemetry.semconv.incubating.PeerIncubatingAttributes.PEER_SERVICE; import static org.assertj.core.api.Assertions.assertThat; @@ -76,6 +79,14 @@ void setCommand() { equalTo(PEER_SERVICE, "test-peer-service"), equalTo(SERVER_ADDRESS, host), equalTo(SERVER_PORT, port)))); + + assertDurationMetric( + testing, + "io.opentelemetry.jedis-1.4", + DB_SYSTEM_NAME, + DB_OPERATION_NAME, + SERVER_ADDRESS, + SERVER_PORT); } @Test diff --git a/instrumentation/jedis/jedis-3.0/javaagent/build.gradle.kts b/instrumentation/jedis/jedis-3.0/javaagent/build.gradle.kts index 8379c562943a..c3def68881c8 100644 --- a/instrumentation/jedis/jedis-3.0/javaagent/build.gradle.kts +++ b/instrumentation/jedis/jedis-3.0/javaagent/build.gradle.kts @@ -31,6 +31,7 @@ dependencies { tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } val testStableSemconv by registering(Test::class) { @@ -38,6 +39,7 @@ tasks { classpath = sourceSets.test.get().runtimeClasspath jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") } check { diff --git a/instrumentation/jedis/jedis-3.0/metadata.yaml b/instrumentation/jedis/jedis-3.0/metadata.yaml new file mode 100644 index 000000000000..5c5305bf31de --- /dev/null +++ b/instrumentation/jedis/jedis-3.0/metadata.yaml @@ -0,0 +1,14 @@ +description: This instrumentation enables database client spans and database client metrics for Jedis Redis operations. +semantic_conventions: + - DATABASE_CLIENT_SPANS + - DATABASE_CLIENT_METRICS +library_link: https://github.com/redis/jedis +configurations: + - name: otel.instrumentation.common.db-statement-sanitizer.enabled + description: Enables statement sanitization for database queries. + type: boolean + default: true + - name: otel.instrumentation.common.peer-service-mapping + description: Used to specify a mapping from host names or IP addresses to peer services. + type: map + default: "" diff --git a/instrumentation/jedis/jedis-4.0/javaagent/build.gradle.kts b/instrumentation/jedis/jedis-4.0/javaagent/build.gradle.kts index 34293541c6f9..d85b0f4e6325 100644 --- a/instrumentation/jedis/jedis-4.0/javaagent/build.gradle.kts +++ b/instrumentation/jedis/jedis-4.0/javaagent/build.gradle.kts @@ -29,6 +29,7 @@ tasks { // latest dep test fails because peer ip is 0:0:0:0:0:0:0:1 instead of 127.0.0.1 jvmArgs("-Djava.net.preferIPv4Stack=true") usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } val testStableSemconv by registering(Test::class) { @@ -36,6 +37,7 @@ tasks { classpath = sourceSets.test.get().runtimeClasspath jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") } check { diff --git a/instrumentation/jedis/jedis-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/Jedis40ClientTest.java b/instrumentation/jedis/jedis-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/Jedis40ClientTest.java index 6522a2bddef8..789e2de0c15b 100644 --- a/instrumentation/jedis/jedis-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/Jedis40ClientTest.java +++ b/instrumentation/jedis/jedis-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/Jedis40ClientTest.java @@ -5,14 +5,17 @@ package io.opentelemetry.javaagent.instrumentation.jedis.v4_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.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_ADDRESS; import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_PEER_PORT; import static io.opentelemetry.semconv.NetworkAttributes.NETWORK_TYPE; 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_STATEMENT; 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 io.opentelemetry.api.trace.SpanKind; @@ -79,6 +82,14 @@ void setCommand() { equalTo(NETWORK_TYPE, "ipv4"), equalTo(NETWORK_PEER_PORT, port), equalTo(NETWORK_PEER_ADDRESS, ip)))); + + assertDurationMetric( + testing, + "io.opentelemetry.jedis-4.0", + DB_SYSTEM_NAME, + DB_OPERATION_NAME, + NETWORK_PEER_ADDRESS, + NETWORK_PEER_PORT); } @Test diff --git a/instrumentation/jedis/jedis-4.0/metadata.yaml b/instrumentation/jedis/jedis-4.0/metadata.yaml new file mode 100644 index 000000000000..0f207087a91b --- /dev/null +++ b/instrumentation/jedis/jedis-4.0/metadata.yaml @@ -0,0 +1,10 @@ +description: This instrumentation enables database client spans and database client metrics for Jedis Redis operations. +semantic_conventions: + - DATABASE_CLIENT_SPANS + - DATABASE_CLIENT_METRICS +library_link: https://github.com/redis/jedis +configurations: + - name: otel.instrumentation.common.db-statement-sanitizer.enabled + description: Enables statement sanitization for database queries. + type: boolean + default: true diff --git a/instrumentation/jetty-httpclient/jetty-httpclient-12.0/metadata.yaml b/instrumentation/jetty-httpclient/jetty-httpclient-12.0/metadata.yaml new file mode 100644 index 000000000000..b944cda370da --- /dev/null +++ b/instrumentation/jetty-httpclient/jetty-httpclient-12.0/metadata.yaml @@ -0,0 +1,35 @@ +description: This instrumentation enables HTTP client spans and HTTP client metrics for Jetty HTTP Client. +semantic_conventions: + - HTTP_CLIENT_SPANS + - HTTP_CLIENT_METRICS +library_link: https://eclipse.dev/jetty/ +configurations: + - 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" + - name: otel.instrumentation.http.client.capture-request-headers + description: List of HTTP request headers to capture in HTTP client telemetry. + type: list + default: "" + - name: otel.instrumentation.http.client.capture-response-headers + description: List of HTTP response headers to capture in HTTP client telemetry. + type: list + default: "" + - name: otel.instrumentation.common.peer-service-mapping + description: Used to specify a mapping from host names or IP addresses to peer services. + type: map + default: "" + - name: otel.instrumentation.http.client.emit-experimental-telemetry + description: > + Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size` + and `http.response.body.size` attributes to spans, and records `http.client.request.size` and + `http.client.response.size` metrics. + type: boolean + default: false + - name: otel.instrumentation.http.client.experimental.redact-query-parameters + description: Redact sensitive URL parameters. See https://opentelemetry.io/docs/specs/semconv/http/http-spans. + type: boolean + default: true \ No newline at end of file diff --git a/instrumentation/jetty-httpclient/jetty-httpclient-9.2/metadata.yaml b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/metadata.yaml new file mode 100644 index 000000000000..b944cda370da --- /dev/null +++ b/instrumentation/jetty-httpclient/jetty-httpclient-9.2/metadata.yaml @@ -0,0 +1,35 @@ +description: This instrumentation enables HTTP client spans and HTTP client metrics for Jetty HTTP Client. +semantic_conventions: + - HTTP_CLIENT_SPANS + - HTTP_CLIENT_METRICS +library_link: https://eclipse.dev/jetty/ +configurations: + - 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" + - name: otel.instrumentation.http.client.capture-request-headers + description: List of HTTP request headers to capture in HTTP client telemetry. + type: list + default: "" + - name: otel.instrumentation.http.client.capture-response-headers + description: List of HTTP response headers to capture in HTTP client telemetry. + type: list + default: "" + - name: otel.instrumentation.common.peer-service-mapping + description: Used to specify a mapping from host names or IP addresses to peer services. + type: map + default: "" + - name: otel.instrumentation.http.client.emit-experimental-telemetry + description: > + Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size` + and `http.response.body.size` attributes to spans, and records `http.client.request.size` and + `http.client.response.size` metrics. + type: boolean + default: false + - name: otel.instrumentation.http.client.experimental.redact-query-parameters + description: Redact sensitive URL parameters. See https://opentelemetry.io/docs/specs/semconv/http/http-spans. + type: boolean + default: true \ No newline at end of file diff --git a/instrumentation/jetty/jetty-11.0/javaagent/build.gradle.kts b/instrumentation/jetty/jetty-11.0/javaagent/build.gradle.kts index 6cbda57bb535..b8a8d7dbe4d9 100644 --- a/instrumentation/jetty/jetty-11.0/javaagent/build.gradle.kts +++ b/instrumentation/jetty/jetty-11.0/javaagent/build.gradle.kts @@ -28,3 +28,7 @@ dependencies { otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_11) } + +tasks.test { + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") +} diff --git a/instrumentation/jetty/jetty-11.0/metadata.yaml b/instrumentation/jetty/jetty-11.0/metadata.yaml new file mode 100644 index 000000000000..60dfbb00c734 --- /dev/null +++ b/instrumentation/jetty/jetty-11.0/metadata.yaml @@ -0,0 +1,27 @@ +description: This instrumentation enables HTTP server spans and HTTP server metrics for Jetty. +semantic_conventions: + - HTTP_SERVER_SPANS + - HTTP_SERVER_METRICS +library_link: https://eclipse.dev/jetty/ +configurations: + - 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" + - name: otel.instrumentation.http.server.capture-request-headers + description: List of HTTP request headers to capture in HTTP server telemetry. + type: list + default: "" + - name: otel.instrumentation.http.server.capture-response-headers + description: List of HTTP response headers to capture in HTTP server telemetry. + type: list + default: "" + - name: otel.instrumentation.http.server.emit-experimental-telemetry + description: > + Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size` + and `http.response.body.size` attributes to spans, and records `http.server.request.size` and + `http.server.response.size` metrics. + type: boolean + default: false \ No newline at end of file diff --git a/instrumentation/jetty/jetty-12.0/javaagent/build.gradle.kts b/instrumentation/jetty/jetty-12.0/javaagent/build.gradle.kts index 4c97e1e4d052..5f4179b86bde 100644 --- a/instrumentation/jetty/jetty-12.0/javaagent/build.gradle.kts +++ b/instrumentation/jetty/jetty-12.0/javaagent/build.gradle.kts @@ -25,3 +25,7 @@ dependencies { otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_17) } + +tasks.test { + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") +} diff --git a/instrumentation/jetty/jetty-12.0/metadata.yaml b/instrumentation/jetty/jetty-12.0/metadata.yaml new file mode 100644 index 000000000000..60dfbb00c734 --- /dev/null +++ b/instrumentation/jetty/jetty-12.0/metadata.yaml @@ -0,0 +1,27 @@ +description: This instrumentation enables HTTP server spans and HTTP server metrics for Jetty. +semantic_conventions: + - HTTP_SERVER_SPANS + - HTTP_SERVER_METRICS +library_link: https://eclipse.dev/jetty/ +configurations: + - 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" + - name: otel.instrumentation.http.server.capture-request-headers + description: List of HTTP request headers to capture in HTTP server telemetry. + type: list + default: "" + - name: otel.instrumentation.http.server.capture-response-headers + description: List of HTTP response headers to capture in HTTP server telemetry. + type: list + default: "" + - name: otel.instrumentation.http.server.emit-experimental-telemetry + description: > + Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size` + and `http.response.body.size` attributes to spans, and records `http.server.request.size` and + `http.server.response.size` metrics. + type: boolean + default: false \ No newline at end of file diff --git a/instrumentation/jetty/jetty-8.0/javaagent/build.gradle.kts b/instrumentation/jetty/jetty-8.0/javaagent/build.gradle.kts index 49d4649d3603..0372b9a20653 100644 --- a/instrumentation/jetty/jetty-8.0/javaagent/build.gradle.kts +++ b/instrumentation/jetty/jetty-8.0/javaagent/build.gradle.kts @@ -38,3 +38,7 @@ if (latestDepTest) { minJavaVersionSupported.set(JavaVersion.VERSION_11) } } + +tasks.test { + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") +} diff --git a/instrumentation/jetty/jetty-8.0/metadata.yaml b/instrumentation/jetty/jetty-8.0/metadata.yaml new file mode 100644 index 000000000000..0c37d998c078 --- /dev/null +++ b/instrumentation/jetty/jetty-8.0/metadata.yaml @@ -0,0 +1,29 @@ +description: This instrumentation enables HTTP server spans and HTTP server metrics for Jetty. +semantic_conventions: + - HTTP_SERVER_SPANS + - HTTP_SERVER_METRICS +features: + - CONTEXT_PROPAGATION +library_link: https://eclipse.dev/jetty/ +configurations: + - 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" + - name: otel.instrumentation.http.server.capture-request-headers + description: List of HTTP request headers to capture in HTTP server telemetry. + type: list + default: "" + - name: otel.instrumentation.http.server.capture-response-headers + description: List of HTTP response headers to capture in HTTP server telemetry. + type: list + default: "" + - name: otel.instrumentation.http.server.emit-experimental-telemetry + description: > + Enable the capture of experimental HTTP server telemetry. Adds the `http.request.body.size` + and `http.response.body.size` attributes to spans, and records `http.server.request.size` and + `http.server.response.size` metrics. + type: boolean + default: false \ No newline at end of file