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
190 changes: 190 additions & 0 deletions docs/instrumentation-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3562,6 +3562,8 @@ libraries:
- org.hibernate.reactive:hibernate-reactive-core:(,)
hikaricp:
- name: hikaricp-3.0
description: |
This instrumentation provides database client metrics for HikariCP 3.0+ connection pools. It reports metrics like connection timeouts, creation time, wait time, and usage time, along with connection pool statistics such as the number of active, idle, and pending connections.
source_path: instrumentation/hikaricp-3.0
scope:
name: io.opentelemetry.hikaricp-3.0
Expand Down Expand Up @@ -3700,12 +3702,42 @@ libraries:
type: STRING
http:
- name: http-url-connection
description: |
This instrumentation enables the generation of HTTP client spans and HTTP client metrics for requests made using `java.net.HttpURLConnection`.
source_path: instrumentation/http-url-connection
scope:
name: io.opentelemetry.http-url-connection
target_versions:
javaagent:
- Java 8+
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:
Expand Down Expand Up @@ -3774,21 +3806,102 @@ libraries:
type: STRING
influxdb:
- name: influxdb-2.4
description: This instrumentation enables the generation of database client spans
and metrics for the InfluxDB Java client.
source_path: instrumentation/influxdb-2.4
scope:
name: io.opentelemetry.influxdb-2.4
target_versions:
javaagent:
- org.influxdb:influxdb-java:[2.4,)
telemetry:
- when: default
spans:
- span_kind: CLIENT
attributes:
- name: db.name
type: STRING
- name: db.operation
type: STRING
- name: db.statement
type: STRING
- name: db.system
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.namespace
type: STRING
- 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.namespace
type: STRING
- name: db.operation.name
type: STRING
- name: db.query.text
type: STRING
- name: db.system.name
type: STRING
- name: server.address
type: STRING
- name: server.port
type: LONG
java:
- name: java-http-client
description: This instrumentation enables HTTP client spans and HTTP client metrics
for requests made using the Java HTTP client.
source_path: instrumentation/java-http-client
minimum_java_version: 11
scope:
name: io.opentelemetry.java-http-client
target_versions:
javaagent:
- Java 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.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:
Expand Down Expand Up @@ -3827,14 +3940,91 @@ libraries:
- name: url.full
type: STRING
- name: java-http-server
description: This instrumentation enables HTTP server spans and HTTP server metrics
for the Java HTTP server.
source_path: instrumentation/java-http-server
scope:
name: io.opentelemetry.java-http-server
target_versions:
javaagent:
- Java 8+
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.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.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.body.size` and `http.server.response.body.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: http.route
type: STRING
- 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.response.status_code
type: LONG
- name: http.route
type: STRING
- 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
javalin:
- name: javalin-5.0
description: This instrumentation enriches existing HTTP server spans with route information,
it does not emit any telemetry on its own.
source_path: instrumentation/javalin-5.0
minimum_java_version: 11
scope:
Expand Down
3 changes: 3 additions & 0 deletions instrumentation-docs/instrumentations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ readonly INSTRUMENTATIONS=(
"hibernate:hibernate-procedure-call-4.3:javaagent:testExperimental"
"hystrix-1.4:javaagent:test"
"hystrix-1.4:javaagent:testExperimental"
"influxdb-2.4:javaagent:test"
"influxdb-2.4:javaagent:testStableSemconv"
"java-http-server:javaagent:test"
)

# Some instrumentation test suites don't run ARM, so we use colima to run them in an x86_64
Expand Down
4 changes: 4 additions & 0 deletions instrumentation/hikaricp-3.0/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description: >
This instrumentation provides database client metrics for HikariCP 3.0+ connection pools. It
reports metrics like connection timeouts, creation time, wait time, and usage time, along with
connection pool statistics such as the number of active, idle, and pending connections.
33 changes: 33 additions & 0 deletions instrumentation/http-url-connection/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
description: >
This instrumentation enables the generation of HTTP client spans and HTTP client metrics for
requests made using `java.net.HttpURLConnection`.
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
2 changes: 2 additions & 0 deletions instrumentation/influxdb-2.4/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ tasks {
// from the okhttp instrumentation we need OkHttp3IgnoredTypesConfigurer to fix context leaks
jvmArgs("-Dotel.instrumentation.okhttp.enabled=false")
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
}

if (!(findProperty("testLatestDeps") as Boolean)) {
Expand All @@ -53,6 +54,7 @@ tasks {
testClassesDirs = sourceSets.test.get().output.classesDirs
classpath = sourceSets.test.get().runtimeClasspath

systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database")
jvmArgs("-Dotel.semconv-stability.opt-in=database")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@

package io.opentelemetry.javaagent.instrumentation.influxdb.v2_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.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_NAME;
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_NAMESPACE;
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 java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;

Expand Down Expand Up @@ -150,6 +154,15 @@ void testQueryWithTwoArguments() {
"SELECT * FROM cpu_load where test1 = ?",
"SELECT",
databaseName))));

assertDurationMetric(
testing,
"io.opentelemetry.influxdb-2.4",
DB_SYSTEM_NAME,
DB_NAMESPACE,
DB_OPERATION_NAME,
SERVER_ADDRESS,
SERVER_PORT);
}

@Test
Expand Down
1 change: 1 addition & 0 deletions instrumentation/influxdb-2.4/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
description: This instrumentation enables the generation of database client spans and metrics for the InfluxDB Java client.
31 changes: 31 additions & 0 deletions instrumentation/java-http-client/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
description: This instrumentation enables HTTP client spans and HTTP client metrics for requests made using the Java HTTP client.
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
4 changes: 4 additions & 0 deletions instrumentation/java-http-server/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ dependencies {
implementation(project(":instrumentation:java-http-server:library"))
testImplementation(project(":instrumentation:java-http-server:testing"))
}

tasks.test {
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
}
Loading