From c944d6d3c4b828c7034834173c33965754d26c96 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Mon, 7 Jul 2025 13:36:43 -0400 Subject: [PATCH 01/13] add descriptions for spring modules --- docs/instrumentation-list.yaml | 305 ++++++++++++++++++ instrumentation-docs/collect.sh | 130 ++++---- instrumentation-docs/readme.md | 2 +- .../javaagent/build.gradle.kts | 4 + .../spring/spring-batch-3.0/metadata.yaml | 14 + .../metadata.yaml | 3 + .../spring-boot-autoconfigure/README.md | 5 +- .../spring-boot-autoconfigure/metadata.yaml | 4 + .../spring-boot-resources/metadata.yaml | 3 + .../javaagent/build.gradle.kts | 8 + .../spring/spring-cloud-aws-3.0/metadata.yaml | 5 + .../spring-cloud-gateway-2.0/metadata.yaml | 10 + .../spring-cloud-gateway-2.2/metadata.yaml | 10 + .../javaagent/build.gradle.kts | 7 + .../spring/spring-core-2.0/metadata.yaml | 5 + .../javaagent/build.gradle.kts | 4 + .../spring-data/spring-data-1.8/metadata.yaml | 4 + 17 files changed, 456 insertions(+), 67 deletions(-) create mode 100644 instrumentation/spring/spring-boot-autoconfigure/metadata.yaml create mode 100644 instrumentation/spring/spring-boot-resources/metadata.yaml create mode 100644 instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml create mode 100644 instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0/metadata.yaml create mode 100644 instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.2/metadata.yaml create mode 100644 instrumentation/spring/spring-core-2.0/metadata.yaml create mode 100644 instrumentation/spring/spring-data/spring-data-1.8/metadata.yaml diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index b7291ea04925..fa49eec82943 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -1122,6 +1122,21 @@ libraries: may contain personal or sensitive information. type: boolean default: false + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - 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 - name: elasticsearch-rest-6.4 source_path: instrumentation/elasticsearch/elasticsearch-rest-6.4 scope: @@ -1135,6 +1150,21 @@ libraries: Enable the capture of search query bodies. It is important to note that Elasticsearch queries may contain personal or sensitive information. type: boolean default: false + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - 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 - name: elasticsearch-rest-7.0 source_path: instrumentation/elasticsearch/elasticsearch-rest-7.0 scope: @@ -1150,6 +1180,21 @@ libraries: Enable the capture of search query bodies. It is important to note that Elasticsearch queries may contain personal or sensitive information. type: boolean default: false + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - 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 - name: elasticsearch-transport-5.0 source_path: instrumentation/elasticsearch/elasticsearch-transport-5.0 scope: @@ -1158,6 +1203,67 @@ libraries: javaagent: - org.elasticsearch.client:transport:[5.0.0,5.3.0) - org.elasticsearch:elasticsearch:[5.0.0,5.3.0) + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + type: STRING + - name: db.system + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - when: otel.instrumentation.elasticsearch.experimental-span-attributes=true + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + type: STRING + - name: db.system + type: STRING + - name: elasticsearch.action + type: STRING + - name: elasticsearch.id + type: STRING + - name: elasticsearch.request + type: STRING + - name: elasticsearch.request.indices + type: STRING + - name: elasticsearch.request.write.type + type: STRING + - name: elasticsearch.response.status + type: LONG + - name: elasticsearch.shard.replication.failed + type: LONG + - name: elasticsearch.shard.replication.successful + type: LONG + - name: elasticsearch.shard.replication.total + type: LONG + - name: elasticsearch.type + type: STRING + - name: elasticsearch.version + type: LONG + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - when: otel.semconv-stability.opt-in=database + spans: + - span_kind: CLIENT + attributes: + - name: db.operation.name + type: STRING + - name: db.system.name + type: STRING + - name: error.type + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG - name: elasticsearch-transport-5.3 source_path: instrumentation/elasticsearch/elasticsearch-transport-5.3 scope: @@ -1166,6 +1272,77 @@ libraries: javaagent: - org.elasticsearch.client:transport:[5.3.0,6.0.0) - org.elasticsearch:elasticsearch:[5.3.0,6.0.0) + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + type: STRING + - name: db.system + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - when: otel.instrumentation.elasticsearch.experimental-span-attributes=true + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + type: STRING + - name: db.system + type: STRING + - name: elasticsearch.action + type: STRING + - name: elasticsearch.id + type: STRING + - name: elasticsearch.request + type: STRING + - name: elasticsearch.request.indices + type: STRING + - name: elasticsearch.request.search.types + type: STRING + - name: elasticsearch.request.write.type + type: STRING + - name: elasticsearch.request.write.version + type: LONG + - name: elasticsearch.response.status + type: LONG + - name: elasticsearch.shard.broadcast.failed + type: LONG + - name: elasticsearch.shard.broadcast.successful + type: LONG + - name: elasticsearch.shard.broadcast.total + type: LONG + - name: elasticsearch.shard.replication.failed + type: LONG + - name: elasticsearch.shard.replication.successful + type: LONG + - name: elasticsearch.shard.replication.total + type: LONG + - name: elasticsearch.type + type: STRING + - name: elasticsearch.version + type: LONG + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - when: otel.semconv-stability.opt-in=database + spans: + - span_kind: CLIENT + attributes: + - name: db.operation.name + type: STRING + - name: db.system.name + type: STRING + - name: error.type + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG - name: elasticsearch-transport-6.0 source_path: instrumentation/elasticsearch/elasticsearch-transport-6.0 scope: @@ -1174,6 +1351,75 @@ libraries: javaagent: - org.elasticsearch:elasticsearch:[6.0.0,8.0.0) - org.elasticsearch.client:transport:[6.0.0,) + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + 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.instrumentation.elasticsearch.experimental-span-attributes=true + spans: + - span_kind: CLIENT + attributes: + - name: db.operation + type: STRING + - name: db.system + type: STRING + - name: elasticsearch.action + type: STRING + - name: elasticsearch.id + type: STRING + - name: elasticsearch.request + type: STRING + - name: elasticsearch.request.indices + type: STRING + - name: elasticsearch.request.write.type + type: STRING + - name: elasticsearch.request.write.version + type: LONG + - name: elasticsearch.response.status + type: LONG + - name: elasticsearch.shard.replication.failed + type: LONG + - name: elasticsearch.shard.replication.successful + type: LONG + - name: elasticsearch.shard.replication.total + type: LONG + - name: elasticsearch.type + type: STRING + - name: elasticsearch.version + type: LONG + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: network.type + type: STRING + - when: otel.semconv-stability.opt-in=database + spans: + - span_kind: CLIENT + attributes: + - name: db.operation.name + type: STRING + - name: db.system.name + type: STRING + - name: error.type + type: STRING + - name: network.peer.address + type: STRING + - name: network.peer.port + type: LONG + - name: network.type + type: STRING executors: - name: executors description: | @@ -3033,6 +3279,7 @@ libraries: - com.sparkjava:spark-core:[2.3,) spring: - name: spring-batch-3.0 + description: Instruments the Spring Batch framework. disabled_by_default: true source_path: instrumentation/spring/spring-batch-3.0 scope: @@ -3040,7 +3287,31 @@ libraries: target_versions: javaagent: - org.springframework.batch:spring-batch-core:[3.0.0.RELEASE,5) + configurations: + - name: otel.instrumentation.spring-batch.experimental-span-attributes + description: Adds the experimental attribute `job.system` to spans. + type: boolean + default: false + - name: otel.instrumentation.spring-batch.experimental.chunk.new-trace + description: When enabled, a new root span will be created for each chunk processing. + Please note that this may lead to a high number of spans being created. + type: boolean + default: false + - name: otel.instrumentation.spring-batch.item.enabled + description: When enabled, spans will be created for each item processed. Please + note that this may lead to a high number of spans being created. + type: boolean + default: false + telemetry: + - when: otel.instrumentation.spring-batch.experimental-span-attributes=true + spans: + - span_kind: INTERNAL + attributes: + - name: job.system + type: STRING - name: spring-boot-actuator-autoconfigure-2.0 + description: | + This instrumentation configures the OpenTelemetry Micrometer bridge to receive metrics from Spring Boot Actuator. It does not produce telemetry on its own. disabled_by_default: true source_path: instrumentation/spring/spring-boot-actuator-autoconfigure-2.0 scope: @@ -3049,10 +3320,14 @@ libraries: javaagent: - org.springframework.boot:spring-boot-actuator-autoconfigure:[2.0.0.RELEASE,) - name: spring-boot-resources + description: | + This instrumentation automatically detects the `service.name` and `service.version` for Spring Boot applications and sets them as resource attributes. source_path: instrumentation/spring/spring-boot-resources scope: name: io.opentelemetry.spring-boot-resources - name: spring-cloud-aws-3.0 + description: | + This instrumentation provides tracing for Spring Cloud AWS SQS, versions 3.0.0 and newer. It augments the existing AWS SDK 2.2 instrumentation by providing higher-level tracing for SQS operations, capturing details specific to Spring Cloud AWS SQS usage and linking them to the underlying AWS SDK traces. source_path: instrumentation/spring/spring-cloud-aws-3.0 minimum_java_version: 17 scope: @@ -3061,13 +3336,24 @@ libraries: javaagent: - io.awspring.cloud:spring-cloud-aws-sqs:[3.0.0,) - name: spring-cloud-gateway-2.0 + description: | + This instrumentation enhances tracing for Spring Cloud Gateway. It does not generate new telemetry on its own, but rather enriches existing traces produced by other instrumentations like Netty and Spring WebFlux with Spring Cloud Gateway-specific attributes. source_path: instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0 scope: name: io.opentelemetry.spring-cloud-gateway-2.0 target_versions: javaagent: - org.springframework.cloud:spring-cloud-starter-gateway:[2.0.0.RELEASE,] + configurations: + - name: otel.instrumentation.spring-cloud-gateway.experimental-span-attributes + description: Enables experimental `spring-cloud-gateway.route` attributes (e.g., + `spring-cloud-gateway.route.id`, `spring-cloud-gateway.route.uri`, etc.) on + spans. + type: boolean + default: false - name: spring-core-2.0 + description: | + This instrumentation ensures proper context propagation for asynchronous operations within Spring Core. It modifies how tasks are submitted and executed to ensure that spans created by other instrumentations are correctly linked across thread boundaries, rather than generating new telemetry itself. source_path: instrumentation/spring/spring-core-2.0 minimum_java_version: 17 scope: @@ -3076,6 +3362,8 @@ libraries: javaagent: - org.springframework:spring-core:[2.0,] - name: spring-data-1.8 + description: | + This instrumentation enhances tracing for Spring Data operations. It works in conjunction with other instrumentations, such as JDBC, to provide additional context and details for database interactions initiated through Spring Data. source_path: instrumentation/spring/spring-data/spring-data-1.8 scope: name: io.opentelemetry.spring-data-1.8 @@ -3083,6 +3371,23 @@ libraries: javaagent: - org.springframework:spring-aop:[1.2,] - org.springframework.data:spring-data-commons:[1.8.0.RELEASE,] + telemetry: + - when: default + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING + - when: otel.semconv-stability.opt-in=database + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING - name: spring-integration-4.1 source_path: instrumentation/spring/spring-integration-4.1 scope: diff --git a/instrumentation-docs/collect.sh b/instrumentation-docs/collect.sh index 832b3626a880..742a0900e9f2 100755 --- a/instrumentation-docs/collect.sh +++ b/instrumentation-docs/collect.sh @@ -6,72 +6,76 @@ set -euo pipefail # Oracle UCP won't run on Apple Silicon, so we need to use colima to run as x86_64 -if [[ "$(uname -m)" == "arm64" || "$(uname -m)" == "aarch64" ]]; then - colima start --arch x86_64 --memory 4 - export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock - export DOCKER_HOST="unix://${HOME}/.colima/docker.sock" -fi +#if [[ "$(uname -m)" == "arm64" || "$(uname -m)" == "aarch64" ]]; then +# colima start --arch x86_64 --memory 4 +# export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock +# export DOCKER_HOST="unix://${HOME}/.colima/docker.sock" +#fi readonly INSTRUMENTATIONS=( # : : [ gradle-task-suffix ] - "activej-http-6.0:javaagent:test" - "akka:akka-http-10.0:javaagent:test" - "apache-httpasyncclient-4.1:javaagent:test" - "alibaba-druid-1.0:javaagent:test" - "alibaba-druid-1.0:javaagent:testStableSemconv" - "apache-dbcp-2.0:javaagent:test" - "apache-dbcp-2.0:javaagent:testStableSemconv" - "apache-httpclient:apache-httpclient-2.0:javaagent:test" - "apache-httpclient:apache-httpclient-4.0:javaagent:test" - "apache-httpclient:apache-httpclient-4.3:library:test" - "apache-httpclient:apache-httpclient-5.0:javaagent:test" - "apache-dubbo-2.7:javaagent:testDubbo" - "c3p0-0.9:javaagent:test" - "c3p0-0.9:javaagent:testStableSemconv" - "clickhouse-client-0.5:javaagent:test" - "clickhouse-client-0.5:javaagent:testStableSemconv" - "aws-sdk:aws-sdk-1.11:javaagent:test" - "google-http-client-1.19:javaagent:test" - "http-url-connection:javaagent:test" - "java-http-client:javaagent:test" - "jetty-httpclient:jetty-httpclient-9.2:javaagent:test" - "jetty-httpclient:jetty-httpclient-12.0:javaagent:test" - "jodd-http-4.2:javaagent:test" - "netty:netty-3.8:javaagent:test" - "netty:netty-4.0:javaagent:test" - "netty:netty-4.1:javaagent:test" - "okhttp:okhttp-2.2:javaagent:test" - "okhttp:okhttp-3.0:javaagent:test" - "pekko:pekko-http-1.0:javaagent:test" - "play:play-ws:play-ws-1.0:javaagent:test" - "play:play-ws:play-ws-2.0:javaagent:test" - "play:play-ws:play-ws-2.1:javaagent:test" - "reactor:reactor-netty:reactor-netty-0.9:javaagent:test" - "reactor:reactor-netty:reactor-netty-1.0:javaagent:test" - "spring:spring-webflux:spring-webflux-5.0:javaagent:test" - "vertx:vertx-http-client:vertx-http-client-3.0:javaagent:test" - "vertx:vertx-http-client:vertx-http-client-4.0:javaagent:test" - "vertx:vertx-http-client:vertx-http-client-5.0:javaagent:test" - "vertx:vertx-redis-client-4.0:javaagent:test" - "vertx:vertx-redis-client-4.0:javaagent:testStableSemconv" - "vertx:vertx-sql-client:vertx-sql-client-4.0:javaagent:test" - "vertx:vertx-sql-client:vertx-sql-client-4.0:javaagent:testStableSemconv" - "vertx:vertx-sql-client:vertx-sql-client-5.0:javaagent:test" - "vertx:vertx-sql-client:vertx-sql-client-5.0:javaagent:testStableSemconv" - "aws-sdk:aws-sdk-1.11:javaagent:testStableSemconv" - "aws-sdk:aws-sdk-2.2:javaagent:test" - "aws-sdk:aws-sdk-2.2:javaagent:testStableSemconv" - "aws-sdk:aws-sdk-2.2:javaagent:testBedrockRuntime" - "hikaricp-3.0:javaagent:test" - "hikaricp-3.0:javaagent:testStableSemconv" - "tomcat:tomcat-jdbc:javaagent:test" - "tomcat:tomcat-jdbc:javaagent:testStableSemconv" - "oracle-ucp-11.2:javaagent:test" - "oracle-ucp-11.2:javaagent:testStableSemconv" - "oshi:javaagent:test" - "oshi:javaagent:testExperimental" - "vibur-dbcp-11.0:javaagent:test" - "vibur-dbcp-11.0:javaagent:testStableSemconv" +# "activej-http-6.0:javaagent:test" +# "akka:akka-http-10.0:javaagent:test" +# "apache-httpasyncclient-4.1:javaagent:test" +# "alibaba-druid-1.0:javaagent:test" +# "alibaba-druid-1.0:javaagent:testStableSemconv" +# "apache-dbcp-2.0:javaagent:test" +# "apache-dbcp-2.0:javaagent:testStableSemconv" +# "apache-httpclient:apache-httpclient-2.0:javaagent:test" +# "apache-httpclient:apache-httpclient-4.0:javaagent:test" +# "apache-httpclient:apache-httpclient-4.3:library:test" +# "apache-httpclient:apache-httpclient-5.0:javaagent:test" +# "apache-dubbo-2.7:javaagent:testDubbo" +# "c3p0-0.9:javaagent:test" +# "c3p0-0.9:javaagent:testStableSemconv" +# "clickhouse-client-0.5:javaagent:test" +# "clickhouse-client-0.5:javaagent:testStableSemconv" +# "aws-sdk:aws-sdk-1.11:javaagent:test" +# "google-http-client-1.19:javaagent:test" +# "http-url-connection:javaagent:test" +# "java-http-client:javaagent:test" +# "jetty-httpclient:jetty-httpclient-9.2:javaagent:test" +# "jetty-httpclient:jetty-httpclient-12.0:javaagent:test" +# "jodd-http-4.2:javaagent:test" +# "netty:netty-3.8:javaagent:test" +# "netty:netty-4.0:javaagent:test" +# "netty:netty-4.1:javaagent:test" +# "okhttp:okhttp-2.2:javaagent:test" +# "okhttp:okhttp-3.0:javaagent:test" +# "pekko:pekko-http-1.0:javaagent:test" +# "play:play-ws:play-ws-1.0:javaagent:test" +# "play:play-ws:play-ws-2.0:javaagent:test" +# "play:play-ws:play-ws-2.1:javaagent:test" +# "reactor:reactor-netty:reactor-netty-0.9:javaagent:test" +# "reactor:reactor-netty:reactor-netty-1.0:javaagent:test" +# "spring:spring-webflux:spring-webflux-5.0:javaagent:test" +# "vertx:vertx-http-client:vertx-http-client-3.0:javaagent:test" +# "vertx:vertx-http-client:vertx-http-client-4.0:javaagent:test" +# "vertx:vertx-http-client:vertx-http-client-5.0:javaagent:test" +# "vertx:vertx-redis-client-4.0:javaagent:test" +# "vertx:vertx-redis-client-4.0:javaagent:testStableSemconv" +# "vertx:vertx-sql-client:vertx-sql-client-4.0:javaagent:test" +# "vertx:vertx-sql-client:vertx-sql-client-4.0:javaagent:testStableSemconv" +# "vertx:vertx-sql-client:vertx-sql-client-5.0:javaagent:test" +# "vertx:vertx-sql-client:vertx-sql-client-5.0:javaagent:testStableSemconv" +# "aws-sdk:aws-sdk-1.11:javaagent:testStableSemconv" +# "aws-sdk:aws-sdk-2.2:javaagent:test" +# "aws-sdk:aws-sdk-2.2:javaagent:testStableSemconv" +# "aws-sdk:aws-sdk-2.2:javaagent:testBedrockRuntime" +# "hikaricp-3.0:javaagent:test" +# "hikaricp-3.0:javaagent:testStableSemconv" +# "tomcat:tomcat-jdbc:javaagent:test" +# "tomcat:tomcat-jdbc:javaagent:testStableSemconv" +# "oracle-ucp-11.2:javaagent:test" +# "oracle-ucp-11.2:javaagent:testStableSemconv" +# "oshi:javaagent:test" +# "oshi:javaagent:testExperimental" +# "vibur-dbcp-11.0:javaagent:test" +# "vibur-dbcp-11.0:javaagent:testStableSemconv" +# "spring:spring-batch-3.0:javaagent:test" +# "spring:spring-cloud-aws-3.0:javaagent:test" + "spring:spring-data:spring-data-1.8:javaagent:test" + "spring:spring-data:spring-data-1.8:javaagent:testStableSemconv" ) readonly TELEMETRY_DIR_NAME=".telemetry" diff --git a/instrumentation-docs/readme.md b/instrumentation-docs/readme.md index 4772b83bd886..cd21cbaf7564 100644 --- a/instrumentation-docs/readme.md +++ b/instrumentation-docs/readme.md @@ -28,7 +28,7 @@ In order to collect spans, add the `collectSpans` property (along with `collectM ```kotlin tasks { test { - systemProperty("collectMetadata", collectMetadata) + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") systemProperty("collectSpans", true) } } diff --git a/instrumentation/spring/spring-batch-3.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-batch-3.0/javaagent/build.gradle.kts index 47bda33c035e..e1fbf70e69b6 100644 --- a/instrumentation/spring/spring-batch-3.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-batch-3.0/javaagent/build.gradle.kts @@ -48,6 +48,10 @@ tasks { excludeTestsMatching("*ItemLevelSpanTest") excludeTestsMatching("*CustomSpanEventTest") } + + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + systemProperty("metaDataConfig", "otel.instrumentation.spring-batch.experimental-span-attributes=true") } check { diff --git a/instrumentation/spring/spring-batch-3.0/metadata.yaml b/instrumentation/spring/spring-batch-3.0/metadata.yaml index 1aee203e711b..2916fdc2854d 100644 --- a/instrumentation/spring/spring-batch-3.0/metadata.yaml +++ b/instrumentation/spring/spring-batch-3.0/metadata.yaml @@ -1 +1,15 @@ disabled_by_default: true +description: Instruments the Spring Batch framework. +configurations: + - name: otel.instrumentation.spring-batch.experimental-span-attributes + type: boolean + description: Adds the experimental attribute `job.system` to spans. + default: false + - name: otel.instrumentation.spring-batch.experimental.chunk.new-trace + type: boolean + description: When enabled, a new root span will be created for each chunk processing. Please note that this may lead to a high number of spans being created. + default: false + - name: otel.instrumentation.spring-batch.item.enabled + type: boolean + description: When enabled, spans will be created for each item processed. Please note that this may lead to a high number of spans being created. + default: false diff --git a/instrumentation/spring/spring-boot-actuator-autoconfigure-2.0/metadata.yaml b/instrumentation/spring/spring-boot-actuator-autoconfigure-2.0/metadata.yaml index 1aee203e711b..d0985f49b067 100644 --- a/instrumentation/spring/spring-boot-actuator-autoconfigure-2.0/metadata.yaml +++ b/instrumentation/spring/spring-boot-actuator-autoconfigure-2.0/metadata.yaml @@ -1 +1,4 @@ disabled_by_default: true +description: > + This instrumentation configures the OpenTelemetry Micrometer bridge to receive metrics from + Spring Boot Actuator. It does not produce telemetry on its own. diff --git a/instrumentation/spring/spring-boot-autoconfigure/README.md b/instrumentation/spring/spring-boot-autoconfigure/README.md index 85b9ea1dbe63..c82ff7f2ac4b 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/README.md +++ b/instrumentation/spring/spring-boot-autoconfigure/README.md @@ -3,8 +3,7 @@ Auto-configures OpenTelemetry instrumentation for [spring-web](../spring-web/spring-web-3.1/library) , [spring-webmvc](../spring-webmvc/spring-webmvc-5.3/library), and [spring-webflux](../spring-webflux/spring-webflux-5.3/library). Leverages Spring Aspect Oriented -Programming, -dependency injection, and bean post-processing to trace spring applications. To include all features -listed below use the [opentelemetry-spring-boot-starter](../starters/spring-boot-starter/README.md). +Programming, dependency injection, and bean post-processing to trace spring applications. To include +all features listed below use the [opentelemetry-spring-boot-starter](../starters/spring-boot-starter/README.md). Documentation for OpenTelemetry Spring Auto-Configuration can be found [here](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/out-of-the-box-instrumentation/). diff --git a/instrumentation/spring/spring-boot-autoconfigure/metadata.yaml b/instrumentation/spring/spring-boot-autoconfigure/metadata.yaml new file mode 100644 index 000000000000..ac354f761c66 --- /dev/null +++ b/instrumentation/spring/spring-boot-autoconfigure/metadata.yaml @@ -0,0 +1,4 @@ +description: > + This instrumentation auto-configures OpenTelemetry instrumentation for spring-web, spring-webmvc, + and spring-webflux to instrument Spring Boot applications. It does not produce telemetry on its + own. diff --git a/instrumentation/spring/spring-boot-resources/metadata.yaml b/instrumentation/spring/spring-boot-resources/metadata.yaml new file mode 100644 index 000000000000..74ddcf379b2e --- /dev/null +++ b/instrumentation/spring/spring-boot-resources/metadata.yaml @@ -0,0 +1,3 @@ +description: > + This instrumentation automatically detects the `service.name` and `service.version` for Spring + Boot applications and sets them as resource attributes. diff --git a/instrumentation/spring/spring-cloud-aws-3.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-cloud-aws-3.0/javaagent/build.gradle.kts index 43d9aab933b3..4f877f7463aa 100644 --- a/instrumentation/spring/spring-cloud-aws-3.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-cloud-aws-3.0/javaagent/build.gradle.kts @@ -30,3 +30,11 @@ dependencies { otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_17) } + +tasks { + test { + // only generates spans from io.opentelemetry.aws-sdk-2.2 scope + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + } +} diff --git a/instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml b/instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml new file mode 100644 index 000000000000..6b9db8e36fb4 --- /dev/null +++ b/instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml @@ -0,0 +1,5 @@ +description: > + This instrumentation provides tracing for Spring Cloud AWS SQS, versions 3.0.0 and newer. + It augments the existing AWS SDK 2.2 instrumentation by providing higher-level tracing for SQS + operations, capturing details specific to Spring Cloud AWS SQS usage and linking them to the + underlying AWS SDK traces. diff --git a/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0/metadata.yaml b/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0/metadata.yaml new file mode 100644 index 000000000000..6ccca41797ca --- /dev/null +++ b/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0/metadata.yaml @@ -0,0 +1,10 @@ +description: > + This instrumentation enhances tracing for Spring Cloud Gateway. It does not generate new telemetry + on its own, but rather enriches existing traces produced by other instrumentations like Netty and + Spring WebFlux with Spring Cloud Gateway-specific attributes. +configurations: + - name: otel.instrumentation.spring-cloud-gateway.experimental-span-attributes + type: boolean + default: false + description: Enables experimental `spring-cloud-gateway.route` attributes (e.g., + `spring-cloud-gateway.route.id`, `spring-cloud-gateway.route.uri`, etc.) on spans. diff --git a/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.2/metadata.yaml b/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.2/metadata.yaml new file mode 100644 index 000000000000..6ccca41797ca --- /dev/null +++ b/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.2/metadata.yaml @@ -0,0 +1,10 @@ +description: > + This instrumentation enhances tracing for Spring Cloud Gateway. It does not generate new telemetry + on its own, but rather enriches existing traces produced by other instrumentations like Netty and + Spring WebFlux with Spring Cloud Gateway-specific attributes. +configurations: + - name: otel.instrumentation.spring-cloud-gateway.experimental-span-attributes + type: boolean + default: false + description: Enables experimental `spring-cloud-gateway.route` attributes (e.g., + `spring-cloud-gateway.route.id`, `spring-cloud-gateway.route.uri`, etc.) on spans. diff --git a/instrumentation/spring/spring-core-2.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-core-2.0/javaagent/build.gradle.kts index e012ab37e1f4..400f444d4952 100644 --- a/instrumentation/spring/spring-core-2.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-core-2.0/javaagent/build.gradle.kts @@ -26,3 +26,10 @@ if (findProperty("testLatestDeps") as Boolean) { minJavaVersionSupported.set(JavaVersion.VERSION_17) } } + +tasks { + test { + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + } +} diff --git a/instrumentation/spring/spring-core-2.0/metadata.yaml b/instrumentation/spring/spring-core-2.0/metadata.yaml new file mode 100644 index 000000000000..6042acd42896 --- /dev/null +++ b/instrumentation/spring/spring-core-2.0/metadata.yaml @@ -0,0 +1,5 @@ +description: > + This instrumentation ensures proper context propagation for asynchronous operations + within Spring Core. It modifies how tasks are submitted and executed to ensure that + spans created by other instrumentations are correctly linked across thread boundaries, + rather than generating new telemetry itself. diff --git a/instrumentation/spring/spring-data/spring-data-1.8/javaagent/build.gradle.kts b/instrumentation/spring/spring-data/spring-data-1.8/javaagent/build.gradle.kts index 6222c25ee933..315ce73380e7 100644 --- a/instrumentation/spring/spring-data/spring-data-1.8/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-data/spring-data-1.8/javaagent/build.gradle.kts @@ -51,10 +51,14 @@ tasks { jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") + + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) } val testStableSemconv by registering(Test::class) { jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metaDataConfig", "otel.semconv-stability.opt-in=database") } check { diff --git a/instrumentation/spring/spring-data/spring-data-1.8/metadata.yaml b/instrumentation/spring/spring-data/spring-data-1.8/metadata.yaml new file mode 100644 index 000000000000..9d4014d548d8 --- /dev/null +++ b/instrumentation/spring/spring-data/spring-data-1.8/metadata.yaml @@ -0,0 +1,4 @@ +description: > + This instrumentation enhances tracing for Spring Data operations. It works in conjunction + with other instrumentations, such as JDBC, to provide additional context and details + for database interactions initiated through Spring Data. From 588d2ee609cba8d05ad507cf8bd48ac354dd7559 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Thu, 10 Jul 2025 05:43:01 -0400 Subject: [PATCH 02/13] more descriptions --- instrumentation-docs/collect.sh | 6 +++--- instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml | 7 +++---- .../spring-cloud-gateway-2.0/metadata.yaml | 3 ++- .../spring-cloud-gateway-2.2/metadata.yaml | 3 ++- instrumentation/spring/spring-core-2.0/metadata.yaml | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/instrumentation-docs/collect.sh b/instrumentation-docs/collect.sh index 742a0900e9f2..cc41a0a47634 100755 --- a/instrumentation-docs/collect.sh +++ b/instrumentation-docs/collect.sh @@ -73,9 +73,9 @@ readonly INSTRUMENTATIONS=( # "vibur-dbcp-11.0:javaagent:test" # "vibur-dbcp-11.0:javaagent:testStableSemconv" # "spring:spring-batch-3.0:javaagent:test" -# "spring:spring-cloud-aws-3.0:javaagent:test" - "spring:spring-data:spring-data-1.8:javaagent:test" - "spring:spring-data:spring-data-1.8:javaagent:testStableSemconv" + "spring:spring-cloud-aws-3.0:javaagent:test" +# "spring:spring-data:spring-data-1.8:javaagent:test" +# "spring:spring-data:spring-data-1.8:javaagent:testStableSemconv" ) readonly TELEMETRY_DIR_NAME=".telemetry" diff --git a/instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml b/instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml index 6b9db8e36fb4..e7ea9fa15697 100644 --- a/instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml +++ b/instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml @@ -1,5 +1,4 @@ description: > - This instrumentation provides tracing for Spring Cloud AWS SQS, versions 3.0.0 and newer. - It augments the existing AWS SDK 2.2 instrumentation by providing higher-level tracing for SQS - operations, capturing details specific to Spring Cloud AWS SQS usage and linking them to the - underlying AWS SDK traces. + This instrumentation enhances tracing for Spring Cloud AWS. It augments the existing AWS SDK + instrumentation by providing higher-level tracing for SQS operations, capturing details specific + to Spring Cloud AWS SQS usage and linking them to the underlying AWS SDK traces. diff --git a/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0/metadata.yaml b/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0/metadata.yaml index 6ccca41797ca..49a20769279a 100644 --- a/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0/metadata.yaml +++ b/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0/metadata.yaml @@ -6,5 +6,6 @@ configurations: - name: otel.instrumentation.spring-cloud-gateway.experimental-span-attributes type: boolean default: false - description: Enables experimental `spring-cloud-gateway.route` attributes (e.g., + description: > + Enables experimental `spring-cloud-gateway.route` attributes (e.g., `spring-cloud-gateway.route.id`, `spring-cloud-gateway.route.uri`, etc.) on spans. diff --git a/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.2/metadata.yaml b/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.2/metadata.yaml index 6ccca41797ca..3dd1f70808ce 100644 --- a/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.2/metadata.yaml +++ b/instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.2/metadata.yaml @@ -6,5 +6,6 @@ configurations: - name: otel.instrumentation.spring-cloud-gateway.experimental-span-attributes type: boolean default: false - description: Enables experimental `spring-cloud-gateway.route` attributes (e.g., + description: > + Enables experimental `spring-cloud-gateway.route` attributes (e.g., `spring-cloud-gateway.route.id`, `spring-cloud-gateway.route.uri`, etc.) on spans. diff --git a/instrumentation/spring/spring-core-2.0/metadata.yaml b/instrumentation/spring/spring-core-2.0/metadata.yaml index 6042acd42896..9203a45df486 100644 --- a/instrumentation/spring/spring-core-2.0/metadata.yaml +++ b/instrumentation/spring/spring-core-2.0/metadata.yaml @@ -2,4 +2,4 @@ description: > This instrumentation ensures proper context propagation for asynchronous operations within Spring Core. It modifies how tasks are submitted and executed to ensure that spans created by other instrumentations are correctly linked across thread boundaries, - rather than generating new telemetry itself. + rather than generating any new telemetry itself. From 7f88ab44c35b6982d25066985193ed3a1aea1dd5 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Wed, 16 Jul 2025 20:39:10 -0400 Subject: [PATCH 03/13] more --- docs/instrumentation-list.yaml | 291 ++++++++++++++++++ instrumentation-docs/collect.sh | 9 +- .../spring-data-3.0/testing/build.gradle.kts | 4 - .../javaagent/build.gradle.kts | 5 + .../spring-integration-4.1/metadata.yaml | 18 ++ 5 files changed, 319 insertions(+), 8 deletions(-) create mode 100644 instrumentation/spring/spring-integration-4.1/metadata.yaml diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index 2f0d88987b57..91db25f38eeb 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -589,6 +589,25 @@ libraries: type: STRING - name: server.port type: LONG + spans: + - span_kind: CLIENT + attributes: + - 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.protocol.version + type: STRING + - name: server.address + type: STRING + - name: server.port + type: LONG + - name: url.full + type: STRING - name: apache-httpclient-5.2 source_path: instrumentation/apache-httpclient/apache-httpclient-5.2 scope: @@ -596,6 +615,45 @@ libraries: target_versions: library: - org.apache.httpcomponents.client5:httpclient5:5.2.1 + telemetry: + - when: default + metrics: + - name: http.client.request.duration + description: Duration of HTTP client 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: server.address + type: STRING + - name: server.port + type: LONG + spans: + - span_kind: CLIENT + attributes: + - name: error.type + type: STRING + - name: http.request.method + type: STRING + - name: http.request.method_original + type: STRING + - name: http.request.resend_count + type: LONG + - name: http.response.status_code + type: LONG + - name: network.protocol.version + type: STRING + - name: server.address + type: STRING + - name: server.port + type: LONG + - name: url.full + type: STRING - name: apache-shenyu-2.4 source_path: instrumentation/apache-shenyu-2.4 scope: @@ -618,6 +676,90 @@ libraries: - com.linecorp.armeria:armeria:[1.3.0,) library: - com.linecorp.armeria:armeria:1.3.0 + telemetry: + - when: default + metrics: + - name: http.client.request.duration + description: Duration of HTTP client 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: server.address + type: STRING + - name: server.port + type: LONG + - 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: CLIENT + attributes: + - name: error.type + type: STRING + - name: http.request.method + 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.full + type: STRING + - 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 - name: armeria-grpc-1.14 source_path: instrumentation/armeria/armeria-grpc-1.14 scope: @@ -633,6 +775,39 @@ libraries: target_versions: javaagent: - com.ning:async-http-client:[1.9.0,) + telemetry: + - when: default + metrics: + - name: http.client.request.duration + description: Duration of HTTP client requests. + type: HISTOGRAM + unit: s + attributes: + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: server.address + type: STRING + - name: server.port + type: LONG + spans: + - span_kind: CLIENT + attributes: + - 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: server.address + type: STRING + - name: server.port + type: LONG + - name: url.full + type: STRING - name: async-http-client-2.0 source_path: instrumentation/async-http-client/async-http-client-2.0 scope: @@ -640,6 +815,47 @@ libraries: target_versions: javaagent: - org.asynchttpclient:async-http-client:[2.0.0,) + telemetry: + - when: default + metrics: + - name: http.client.request.duration + description: Duration of HTTP client 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: server.address + type: STRING + - name: server.port + type: LONG + spans: + - span_kind: CLIENT + attributes: + - 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.full + type: STRING avaje: - name: avaje-jex-3.0 description: | @@ -1484,6 +1700,15 @@ libraries: javaagent: - com.twitter:finatra-http_2.11:[2.9.0,] - com.twitter:finatra-http_2.12:[2.9.0,] + telemetry: + - when: default + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING geode: - name: geode-1.4 source_path: instrumentation/geode-1.4 @@ -2194,6 +2419,8 @@ libraries: - org.apache.tomcat:tomcat-jasper:[7.0.19,10) kafka: - name: kafka-clients-0.11 + description: | + This instrumentation provides messaging spans and metrics for Apache Kafka 0.11 clients. It automatically traces message production and consumption, propagates context, and emits metrics for production and consumption. source_path: instrumentation/kafka/kafka-clients/kafka-clients-0.11 scope: name: io.opentelemetry.kafka-clients-0.11 @@ -2209,7 +2436,17 @@ libraries: description: Enables the capture of the experimental consumer attribute "kafka.record.queue_time_ms" type: boolean default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: Enables experimental receive telemetry for Kafka instrumentation. + type: boolean + default: false - name: kafka-clients-2.6 + description: | + This instrumentation provides a library integeration that enables messaging spans and metrics for Apache Kafka 2.6+ clients. source_path: instrumentation/kafka/kafka-clients/kafka-clients-2.6 scope: name: io.opentelemetry.kafka-clients-2.6 @@ -3306,6 +3543,7 @@ libraries: - com.sparkjava:spark-core:[2.3,) spring: - name: spring-batch-3.0 + description: Instruments the Spring Batch framework. disabled_by_default: true source_path: instrumentation/spring/spring-batch-3.0 scope: @@ -3313,7 +3551,31 @@ libraries: target_versions: javaagent: - org.springframework.batch:spring-batch-core:[3.0.0.RELEASE,5) + configurations: + - name: otel.instrumentation.spring-batch.experimental-span-attributes + description: Adds the experimental attribute `job.system` to spans. + type: boolean + default: false + - name: otel.instrumentation.spring-batch.experimental.chunk.new-trace + description: When enabled, a new root span will be created for each chunk processing. + Please note that this may lead to a high number of spans being created. + type: boolean + default: false + - name: otel.instrumentation.spring-batch.item.enabled + description: When enabled, spans will be created for each item processed. Please + note that this may lead to a high number of spans being created. + type: boolean + default: false + telemetry: + - when: otel.instrumentation.spring-batch.experimental-span-attributes=true + spans: + - span_kind: INTERNAL + attributes: + - name: job.system + type: STRING - name: spring-boot-actuator-autoconfigure-2.0 + description: | + This instrumentation configures the OpenTelemetry Micrometer bridge to receive metrics from Spring Boot Actuator. It does not produce telemetry on its own. disabled_by_default: true source_path: instrumentation/spring/spring-boot-actuator-autoconfigure-2.0 scope: @@ -3322,10 +3584,14 @@ libraries: javaagent: - org.springframework.boot:spring-boot-actuator-autoconfigure:[2.0.0.RELEASE,) - name: spring-boot-resources + description: | + This instrumentation automatically detects the `service.name` and `service.version` for Spring Boot applications and sets them as resource attributes. source_path: instrumentation/spring/spring-boot-resources scope: name: io.opentelemetry.spring-boot-resources - name: spring-cloud-aws-3.0 + description: | + This instrumentation enhances tracing for Spring Cloud AWS. It augments the existing AWS SDK instrumentation by providing higher-level tracing for SQS operations, capturing details specific to Spring Cloud AWS SQS usage and linking them to the underlying AWS SDK traces. source_path: instrumentation/spring/spring-cloud-aws-3.0 minimum_java_version: 17 scope: @@ -3334,13 +3600,23 @@ libraries: javaagent: - io.awspring.cloud:spring-cloud-aws-sqs:[3.0.0,) - name: spring-cloud-gateway-2.0 + description: | + This instrumentation enhances tracing for Spring Cloud Gateway. It does not generate new telemetry on its own, but rather enriches existing traces produced by other instrumentations like Netty and Spring WebFlux with Spring Cloud Gateway-specific attributes. source_path: instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0 scope: name: io.opentelemetry.spring-cloud-gateway-2.0 target_versions: javaagent: - org.springframework.cloud:spring-cloud-starter-gateway:[2.0.0.RELEASE,] + configurations: + - name: otel.instrumentation.spring-cloud-gateway.experimental-span-attributes + description: | + Enables experimental `spring-cloud-gateway.route` attributes (e.g., `spring-cloud-gateway.route.id`, `spring-cloud-gateway.route.uri`, etc.) on spans. + type: boolean + default: false - name: spring-core-2.0 + description: | + This instrumentation ensures proper context propagation for asynchronous operations within Spring Core. It modifies how tasks are submitted and executed to ensure that spans created by other instrumentations are correctly linked across thread boundaries, rather than generating any new telemetry itself. source_path: instrumentation/spring/spring-core-2.0 minimum_java_version: 17 scope: @@ -3349,6 +3625,8 @@ libraries: javaagent: - org.springframework:spring-core:[2.0,] - name: spring-data-1.8 + description: | + This instrumentation enhances tracing for Spring Data operations. It works in conjunction with other instrumentations, such as JDBC, to provide additional context and details for database interactions initiated through Spring Data. source_path: instrumentation/spring/spring-data/spring-data-1.8 scope: name: io.opentelemetry.spring-data-1.8 @@ -3356,6 +3634,15 @@ libraries: javaagent: - org.springframework:spring-aop:[1.2,] - org.springframework.data:spring-data-commons:[1.8.0.RELEASE,] + telemetry: + - when: default + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING - name: spring-integration-4.1 source_path: instrumentation/spring/spring-integration-4.1 scope: @@ -3965,6 +4252,10 @@ internal: source_path: instrumentation/internal/internal-reflection scope: name: io.opentelemetry.internal-reflection +- name: opentelemetry-api-1.52 + source_path: instrumentation/opentelemetry-api/opentelemetry-api-1.52 + scope: + name: io.opentelemetry.opentelemetry-api-1.52 - name: opentelemetry-instrumentation-api source_path: instrumentation/opentelemetry-instrumentation-api scope: diff --git a/instrumentation-docs/collect.sh b/instrumentation-docs/collect.sh index 6deafe4511c9..45942b770306 100755 --- a/instrumentation-docs/collect.sh +++ b/instrumentation-docs/collect.sh @@ -84,10 +84,11 @@ readonly INSTRUMENTATIONS=( # "elasticsearch:elasticsearch-transport-6.0:javaagent:elasticsearch7TestExperimental" # "spring:spring-batch-3.0:javaagent:test" - "spring:spring-data:spring-data-1.8:javaagent:test" -# "spring:spring-data:spring-data-3.0:testing:test" -# "spring:spring-data:spring-data-3.0:testing:reactiveTest" -# "spring:spring-data:spring-data-3.0:testing:testStableSemconv" +# "spring:spring-data:spring-data-1.8:javaagent:test" + + "spring:spring-integration-4.1:javaagent:test" + "spring:spring-integration-4.1:javaagent:testWithRabbitInstrumentation" + "spring:spring-integration-4.1:javaagent:testWithProducerInstrumentation" ) diff --git a/instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts b/instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts index 69a4edcf61b2..ae7755f0fca2 100644 --- a/instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts +++ b/instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts @@ -45,14 +45,10 @@ tasks { jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") - - systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") - systemProperty("collectSpans", true) } val testStableSemconv by registering(Test::class) { jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metaDataConfig", "otel.semconv-stability.opt-in=database,otel.instrumentation.common.experimental.controller-telemetry.enabled=true") } check { diff --git a/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts b/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts index aba0ea05a7e0..08bbb64cc403 100644 --- a/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts @@ -48,6 +48,7 @@ tasks { include("**/SpringIntegrationAndRabbitTest.*") jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=true") jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=true") + systemProperty("metaDataConfig", "otel.instrumentation.rabbitmq.enabled=true,otel.instrumentation.spring-rabbit.enabled=true") } val testWithProducerInstrumentation by registering(Test::class) { @@ -58,6 +59,7 @@ tasks { jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=false") jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=false") jvmArgs("-Dotel.instrumentation.spring-integration.producer.enabled=true") + systemProperty("metaDataConfig", "otel.instrumentation.spring-integration.producer.enabled=true") } test { @@ -77,6 +79,9 @@ tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) + + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) } } diff --git a/instrumentation/spring/spring-integration-4.1/metadata.yaml b/instrumentation/spring/spring-integration-4.1/metadata.yaml new file mode 100644 index 000000000000..1e2e86e878f3 --- /dev/null +++ b/instrumentation/spring/spring-integration-4.1/metadata.yaml @@ -0,0 +1,18 @@ +description: This instrumentation enables PRODUCER and CONSUMER spans for Spring Integration. +configurations: + - name: otel.instrumentation.spring-integration.producer.enabled + type: boolean + description: > + Create producer spans when messages are sent to an output channel. Enable when you're using + a messaging library that doesn't have its own instrumentation for generating producer spans. + Note that the detection of output channels only works for Spring Cloud Stream `DirectWithAttributesChannel`. + default: false + - name: otel.instrumentation.spring-integration.global-channel-interceptor-patterns + type: list + description: An array of Spring channel name patterns that will be intercepted. + default: "*" + - name: otel.instrumentation.messaging.experimental.capture-headers + type: list + description: Allows configuring headers to capture as span attributes. + default: '' + From 26e44b3790ca98edd08496dae21bfd7835afd4b6 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Sat, 19 Jul 2025 21:13:49 -0400 Subject: [PATCH 04/13] more spring --- ...ntelemetry-instrumentation-annotations.txt | 2 +- .../opentelemetry-instrumentation-api.txt | 2 +- docs/instrumentation-list.yaml | 60 +++++++++++++++++++ instrumentation-docs/collect.sh | 20 ++++++- .../aws-sdk/aws-sdk-1.11/metadata.yaml | 4 +- .../aws-sdk/aws-sdk-2.2/metadata.yaml | 4 +- .../kafka-clients-0.11/metadata.yaml | 4 +- instrumentation/spring/README.md | 2 + .../spring-jms-2.0/javaagent/build.gradle.kts | 2 + .../spring-jms/spring-jms-2.0/metadata.yaml | 12 ++++ .../spring-jms-6.0/javaagent/build.gradle.kts | 2 + .../spring-jms/spring-jms-6.0/metadata.yaml | 12 ++++ .../javaagent/build.gradle.kts | 8 +++ .../spring/spring-kafka-2.7/metadata.yaml | 16 +++++ .../javaagent/build.gradle.kts | 6 +- .../spring/spring-pulsar-1.0/metadata.yaml | 17 ++++++ .../pulsar/v1_0/AbstractSpringPulsarTest.java | 11 +++- .../javaagent/build.gradle.kts | 2 + .../spring/spring-rabbit-1.0/metadata.yaml | 6 ++ .../spring-rmi-4.0/javaagent/build.gradle.kts | 2 + .../spring/spring-rmi-4.0/metadata.yaml | 1 + .../javaagent/build.gradle.kts | 19 ++++-- .../scheduling/v3_1/SpringSchedulingTest.java | 16 +++-- .../spring-scheduling-3.1/metadata.yaml | 6 ++ .../library/build.gradle.kts | 6 ++ .../spring-security-config-6.0/metadata.yaml | 26 ++++++++ 26 files changed, 247 insertions(+), 21 deletions(-) create mode 100644 instrumentation/spring/spring-jms/spring-jms-2.0/metadata.yaml create mode 100644 instrumentation/spring/spring-jms/spring-jms-6.0/metadata.yaml create mode 100644 instrumentation/spring/spring-kafka-2.7/metadata.yaml create mode 100644 instrumentation/spring/spring-pulsar-1.0/metadata.yaml create mode 100644 instrumentation/spring/spring-rabbit-1.0/metadata.yaml create mode 100644 instrumentation/spring/spring-rmi-4.0/metadata.yaml create mode 100644 instrumentation/spring/spring-scheduling-3.1/metadata.yaml create mode 100644 instrumentation/spring/spring-security-config-6.0/metadata.yaml diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt b/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt index 8db08b34caf2..439a9b5ccb5f 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-instrumentation-annotations-2.18.0-SNAPSHOT.jar against opentelemetry-instrumentation-annotations-2.17.1.jar +Comparing source compatibility of opentelemetry-instrumentation-annotations-2.18.0-SNAPSHOT.jar against opentelemetry-instrumentation-annotations-2.18.0.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt b/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt index 8c37dc53ad4e..79292c17b6d4 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-instrumentation-api-2.18.0-SNAPSHOT.jar against opentelemetry-instrumentation-api-2.17.1.jar +Comparing source compatibility of opentelemetry-instrumentation-api-2.18.0-SNAPSHOT.jar against opentelemetry-instrumentation-api-2.18.0.jar No changes. \ No newline at end of file diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index 91db25f38eeb..6db9e293d9cc 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -3644,6 +3644,8 @@ libraries: - name: code.namespace type: STRING - name: spring-integration-4.1 + description: This instrumentation enables PRODUCER and CONSUMER spans for Spring + Integration. source_path: instrumentation/spring/spring-integration-4.1 scope: name: io.opentelemetry.spring-integration-4.1 @@ -3652,6 +3654,39 @@ libraries: - org.springframework.integration:spring-integration-core:[4.1.0.RELEASE,) library: - org.springframework.integration:spring-integration-core:[4.1.0.RELEASE,5.+) + configurations: + - name: otel.instrumentation.spring-integration.producer.enabled + description: | + Create producer spans when messages are sent to an output channel. Enable when you're using a messaging library that doesn't have its own instrumentation for generating producer spans. Note that the detection of output channels only works for Spring Cloud Stream `DirectWithAttributesChannel`. + type: boolean + default: false + - name: otel.instrumentation.spring-integration.global-channel-interceptor-patterns + description: An array of Spring channel name patterns that will be intercepted. + type: list + default: '*' + - name: otel.instrumentation.messaging.experimental.capture-headers + description: Allows configuring headers to capture as span attributes. + type: list + default: '' + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.header.test_message_header + type: STRING_ARRAY + - name: messaging.operation + type: STRING + - when: otel.instrumentation.spring-integration.producer.enabled=true + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.operation + type: STRING + - span_kind: PRODUCER + attributes: + - name: messaging.operation + type: STRING - name: spring-jms-2.0 source_path: instrumentation/spring/spring-jms/spring-jms-2.0 scope: @@ -3659,6 +3694,31 @@ libraries: target_versions: javaagent: - org.springframework:spring-jms:[2.0,6) + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.destination.name + type: STRING + - name: messaging.message.id + type: STRING + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING + - when: otel.instrumentation.messaging.experimental.receive-telemetry.enabled=true + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.destination.name + type: STRING + - name: messaging.message.id + type: STRING + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING - name: spring-jms-6.0 source_path: instrumentation/spring/spring-jms/spring-jms-6.0 minimum_java_version: 17 diff --git a/instrumentation-docs/collect.sh b/instrumentation-docs/collect.sh index 45942b770306..721bfe61752f 100755 --- a/instrumentation-docs/collect.sh +++ b/instrumentation-docs/collect.sh @@ -86,13 +86,27 @@ readonly INSTRUMENTATIONS=( # "spring:spring-batch-3.0:javaagent:test" # "spring:spring-data:spring-data-1.8:javaagent:test" - "spring:spring-integration-4.1:javaagent:test" - "spring:spring-integration-4.1:javaagent:testWithRabbitInstrumentation" - "spring:spring-integration-4.1:javaagent:testWithProducerInstrumentation" +# "spring:spring-integration-4.1:javaagent:test" +# "spring:spring-integration-4.1:javaagent:testWithRabbitInstrumentation" +# "spring:spring-integration-4.1:javaagent:testWithProducerInstrumentation" + +# "spring:spring-jms:spring-jms-2.0:javaagent:test" +# "spring:spring-kafka-2.7:javaagent:test" +# "spring:spring-kafka-2.7:javaagent:testNoReceiveTelemetry" +# "spring:spring-pulsar-1.0:javaagent:test" +# "spring:spring-rabbit-1.0:javaagent:test" +# "spring:spring-rmi-4.0:javaagent:test" +# "spring:spring-scheduling-3.1:javaagent:test" +# "spring:spring-scheduling-3.1:javaagent:testExperimental" + "spring:spring-security-config-6.0:library:test" + + + ) readonly COLIMA_INSTRUMENTATIONS=( +# "spring:spring-jms:spring-jms-6.0:javaagent:test" # "elasticsearch:elasticsearch-rest-6.4:javaagent:test" # "elasticsearch:elasticsearch-rest-5.0:javaagent:test" # "oracle-ucp-11.2:javaagent:test" diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/metadata.yaml b/instrumentation/aws-sdk/aws-sdk-1.11/metadata.yaml index 05882d602281..eb5b641b5f79 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/metadata.yaml +++ b/instrumentation/aws-sdk/aws-sdk-1.11/metadata.yaml @@ -4,7 +4,9 @@ configurations: type: boolean default: false - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - description: Enables experimental receive telemetry for AWS SDK instrumentation. + description: > + Enables experimental receive telemetry, which will cause consumers to start a new trace, with + only a span link connecting it to the producer trace. type: boolean default: false - name: otel.instrumentation.messaging.experimental.capture-headers diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/metadata.yaml b/instrumentation/aws-sdk/aws-sdk-2.2/metadata.yaml index 732d5818dd7e..6c5b84fb780f 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/metadata.yaml +++ b/instrumentation/aws-sdk/aws-sdk-2.2/metadata.yaml @@ -1,6 +1,8 @@ configurations: - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - description: Enables experimental receive telemetry for AWS SDK instrumentation. + description: > + Enables experimental receive telemetry, which will cause consumers to start a new trace, with + only a span link connecting it to the producer trace. type: boolean default: false - name: otel.instrumentation.messaging.experimental.capture-headers diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-0.11/metadata.yaml b/instrumentation/kafka/kafka-clients/kafka-clients-0.11/metadata.yaml index 5da6ed1a9c89..e361ccef9366 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-0.11/metadata.yaml +++ b/instrumentation/kafka/kafka-clients/kafka-clients-0.11/metadata.yaml @@ -15,6 +15,8 @@ configurations: type: list default: '' - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - description: Enables experimental receive telemetry for Kafka instrumentation. + description: > + Enables experimental receive telemetry, which will cause consumers to start a new trace, with + only a span link connecting it to the producer trace. type: boolean default: false diff --git a/instrumentation/spring/README.md b/instrumentation/spring/README.md index 7e6d9cbff67a..053764aa18d1 100644 --- a/instrumentation/spring/README.md +++ b/instrumentation/spring/README.md @@ -17,3 +17,5 @@ This package streamlines the manual instrumentation process of OpenTelemetry for | `otel.instrumentation.spring-scheduling.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes for Spring Scheduling version 3.1. | | `otel.instrumentation.spring-webflux.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes for Spring WebFlux version 5.0. | | `otel.instrumentation.spring-webmvc.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes for Spring Web MVC version 3.1. | +| `otel.instrumentation.messaging.experimental.receive-telemetry.enabled` | Boolean | `false` | Enables experimental receive telemetry for Spring JMS instrumentation. | +| `otel.instrumentation.kafka.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes for Spring Kafka version 2.7. | diff --git a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/build.gradle.kts index 5b74d91f8fd3..692c143880f0 100644 --- a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/build.gradle.kts @@ -61,6 +61,8 @@ configurations { tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) } // this does not apply to testReceiveSpansDisabled test { diff --git a/instrumentation/spring/spring-jms/spring-jms-2.0/metadata.yaml b/instrumentation/spring/spring-jms/spring-jms-2.0/metadata.yaml new file mode 100644 index 000000000000..a589b17881a5 --- /dev/null +++ b/instrumentation/spring/spring-jms/spring-jms-2.0/metadata.yaml @@ -0,0 +1,12 @@ +description: This instrumentation enables the generation of CONSUMER spans for Spring JMS. +configurations: + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: > + Enables experimental receive telemetry, which will cause consumers to start a new trace, with + only a span link connecting it to the producer trace. + type: boolean + default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' diff --git a/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/build.gradle.kts index a6d71b1279d7..772bc3151067 100644 --- a/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/build.gradle.kts @@ -37,6 +37,8 @@ otelJava { tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) } val testReceiveSpansDisabled by registering(Test::class) { diff --git a/instrumentation/spring/spring-jms/spring-jms-6.0/metadata.yaml b/instrumentation/spring/spring-jms/spring-jms-6.0/metadata.yaml new file mode 100644 index 000000000000..a589b17881a5 --- /dev/null +++ b/instrumentation/spring/spring-jms/spring-jms-6.0/metadata.yaml @@ -0,0 +1,12 @@ +description: This instrumentation enables the generation of CONSUMER spans for Spring JMS. +configurations: + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: > + Enables experimental receive telemetry, which will cause consumers to start a new trace, with + only a span link connecting it to the producer trace. + type: boolean + default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' diff --git a/instrumentation/spring/spring-kafka-2.7/javaagent/build.gradle.kts b/instrumentation/spring/spring-kafka-2.7/javaagent/build.gradle.kts index 9e4134b2a079..005cf9b0cc4d 100644 --- a/instrumentation/spring/spring-kafka-2.7/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-kafka-2.7/javaagent/build.gradle.kts @@ -32,6 +32,7 @@ dependencies { } val latestDepTest = findProperty("testLatestDeps") as Boolean +val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" testing { suites { @@ -54,6 +55,9 @@ testing { jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=false") jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=false") + + systemProperty("collectMetadata", collectMetadata) + systemProperty("collectSpans", true) } } } @@ -68,6 +72,10 @@ tasks { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=true") jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true") + + systemProperty("metaDataConfig", "otel.instrumentation.kafka.experimental-span-attributes=true") + systemProperty("collectMetadata", collectMetadata) + systemProperty("collectSpans", true) } check { diff --git a/instrumentation/spring/spring-kafka-2.7/metadata.yaml b/instrumentation/spring/spring-kafka-2.7/metadata.yaml new file mode 100644 index 000000000000..a5ad7b76bd14 --- /dev/null +++ b/instrumentation/spring/spring-kafka-2.7/metadata.yaml @@ -0,0 +1,16 @@ +description: This instrumentation enables CONSUMER spans for Spring Kafka listeners. +configurations: + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: > + Enables experimental receive telemetry, which will cause consumers to start a new trace, with + only a span link connecting it to the producer trace. + type: boolean + default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + - name: otel.instrumentation.kafka.experimental-span-attributes + description: Enables capturing experimental span attribute `kafka.record.queue_time_ms` + type: boolean + default: false diff --git a/instrumentation/spring/spring-pulsar-1.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-pulsar-1.0/javaagent/build.gradle.kts index 9364d6f73d9e..58e691ec9079 100644 --- a/instrumentation/spring/spring-pulsar-1.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-pulsar-1.0/javaagent/build.gradle.kts @@ -25,6 +25,7 @@ dependencies { } val latestDepTest = findProperty("testLatestDeps") as Boolean +val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" testing { suites { @@ -61,8 +62,11 @@ tasks { test { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) - jvmArgs("-Dotel.instrumentation.pulsar.experimental-span-attributes=true") + jvmArgs("-Dotel.instrumentation.pulsar.experimental-span-attributes=false") jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true") + + systemProperty("collectMetadata", collectMetadata) + systemProperty("collectSpans", true) } check { diff --git a/instrumentation/spring/spring-pulsar-1.0/metadata.yaml b/instrumentation/spring/spring-pulsar-1.0/metadata.yaml new file mode 100644 index 000000000000..284ded7953bf --- /dev/null +++ b/instrumentation/spring/spring-pulsar-1.0/metadata.yaml @@ -0,0 +1,17 @@ +description: This instrumentation enables CONSUMER spans for Spring Pulsar listeners. +configurations: + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: > + Enables experimental receive telemetry, which will cause consumers to start a new trace, with + only a span link connecting it to the producer trace. + type: boolean + default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + - name: otel.instrumentation.pulsar.experimental-span-attributes + description: > + Enables capturing experimental span attribute `messaging.pulsar.message.type` on PRODUCER spans. + type: boolean + default: false diff --git a/instrumentation/spring/spring-pulsar-1.0/testing/src/main/java/io/opentelemetry/instrumentation/spring/pulsar/v1_0/AbstractSpringPulsarTest.java b/instrumentation/spring/spring-pulsar-1.0/testing/src/main/java/io/opentelemetry/instrumentation/spring/pulsar/v1_0/AbstractSpringPulsarTest.java index 336a722fa030..2829c3ffeb56 100644 --- a/instrumentation/spring/spring-pulsar-1.0/testing/src/main/java/io/opentelemetry/instrumentation/spring/pulsar/v1_0/AbstractSpringPulsarTest.java +++ b/instrumentation/spring/spring-pulsar-1.0/testing/src/main/java/io/opentelemetry/instrumentation/spring/pulsar/v1_0/AbstractSpringPulsarTest.java @@ -51,6 +51,8 @@ public abstract class AbstractSpringPulsarTest { @RegisterExtension protected static final InstrumentationExtension testing = AgentInstrumentationExtension.create(); + static final String EXPERIMENTAL_FLAG = + "otel.instrumentation.pulsar.experimental-span-attributes"; static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("apachepulsar/pulsar:4.0.2"); static PulsarContainer pulsarContainer; @@ -121,7 +123,14 @@ protected List publishAttributes() { satisfies(MESSAGING_MESSAGE_ID, AbstractStringAssert::isNotEmpty), equalTo(SERVER_ADDRESS, brokerHost), equalTo(SERVER_PORT, brokerPort), - equalTo(MESSAGE_TYPE, "normal")); + equalTo(MESSAGE_TYPE, experimental("normal"))); + } + + protected static String experimental(String value) { + if (!Boolean.getBoolean(EXPERIMENTAL_FLAG)) { + return null; + } + return value; } protected List processAttributes() { diff --git a/instrumentation/spring/spring-rabbit-1.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-rabbit-1.0/javaagent/build.gradle.kts index d3a8bcfee273..664b1804afb0 100644 --- a/instrumentation/spring/spring-rabbit-1.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-rabbit-1.0/javaagent/build.gradle.kts @@ -26,6 +26,8 @@ dependencies { tasks { test { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) } } diff --git a/instrumentation/spring/spring-rabbit-1.0/metadata.yaml b/instrumentation/spring/spring-rabbit-1.0/metadata.yaml new file mode 100644 index 000000000000..d2f998d11b51 --- /dev/null +++ b/instrumentation/spring/spring-rabbit-1.0/metadata.yaml @@ -0,0 +1,6 @@ +description: This instrumentation enables CONSUMER spans for Spring RabbitMQ listeners. +configurations: + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' diff --git a/instrumentation/spring/spring-rmi-4.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-rmi-4.0/javaagent/build.gradle.kts index 0ad0491813c5..b4e41d653115 100644 --- a/instrumentation/spring/spring-rmi-4.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-rmi-4.0/javaagent/build.gradle.kts @@ -35,6 +35,8 @@ otelJava { tasks.withType().configureEach { jvmArgs("-Djava.rmi.server.hostname=127.0.0.1") + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) } configurations.testRuntimeClasspath { diff --git a/instrumentation/spring/spring-rmi-4.0/metadata.yaml b/instrumentation/spring/spring-rmi-4.0/metadata.yaml new file mode 100644 index 000000000000..9c6f21ea242d --- /dev/null +++ b/instrumentation/spring/spring-rmi-4.0/metadata.yaml @@ -0,0 +1 @@ +description: This instrumentation enables CLIENT and SERVER spans for Spring RMI applications. diff --git a/instrumentation/spring/spring-scheduling-3.1/javaagent/build.gradle.kts b/instrumentation/spring/spring-scheduling-3.1/javaagent/build.gradle.kts index 06df6d1fb29c..d121a4b56e34 100644 --- a/instrumentation/spring/spring-scheduling-3.1/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-scheduling-3.1/javaagent/build.gradle.kts @@ -20,13 +20,20 @@ dependencies { testLibrary("org.springframework:spring-context:3.2.3.RELEASE") } -tasks.withType().configureEach { - // TODO run tests both with and without experimental span attributes - jvmArgs("-Dotel.instrumentation.spring-scheduling.experimental-span-attributes=true") +tasks { + withType().configureEach { + // required on jdk17 + jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") + jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") - // required on jdk17 - jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") - jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + } + + val testExperimental by registering(Test::class) { + jvmArgs("-Dotel.instrumentation.spring-scheduling.experimental-span-attributes=true") + systemProperty("metaDataConfig", "otel.instrumentation.spring-scheduling.experimental-span-attributes=true") + } } val latestDepTest = findProperty("testLatestDeps") as Boolean diff --git a/instrumentation/spring/spring-scheduling-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/SpringSchedulingTest.java b/instrumentation/spring/spring-scheduling-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/SpringSchedulingTest.java index f6a01be9085c..89a0f436ce2a 100644 --- a/instrumentation/spring/spring-scheduling-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/SpringSchedulingTest.java +++ b/instrumentation/spring/spring-scheduling-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/scheduling/v3_1/SpringSchedulingTest.java @@ -39,6 +39,9 @@ class SpringSchedulingTest { + private static final String EXPERIMENTAL_FLAG = + "otel.instrumentation.spring-scheduling.experimental-span-attributes"; + @RegisterExtension private static final InstrumentationExtension testing = AgentInstrumentationExtension.create(); @@ -54,6 +57,9 @@ void scheduleOneTimeTest() throws InterruptedException { } } + private static final String JOB_SYSTEM = + Boolean.getBoolean(EXPERIMENTAL_FLAG) ? "spring_scheduling" : null; + @Test void scheduleCronExpressionTest() throws InterruptedException { try (AnnotationConfigApplicationContext context = @@ -62,7 +68,7 @@ void scheduleCronExpressionTest() throws InterruptedException { task.blockUntilExecute(); List assertions = codeFunctionAssertions(TriggerTask.class, "run"); - assertions.add(equalTo(AttributeKey.stringKey("job.system"), "spring_scheduling")); + assertions.add(equalTo(AttributeKey.stringKey("job.system"), JOB_SYSTEM)); assertThat(task).isNotNull(); testing.waitAndAssertTraces( @@ -83,7 +89,7 @@ void scheduleIntervalTest() throws InterruptedException { task.blockUntilExecute(); List assertions = codeFunctionAssertions(IntervalTask.class, "run"); - assertions.add(equalTo(AttributeKey.stringKey("job.system"), "spring_scheduling")); + assertions.add(equalTo(AttributeKey.stringKey("job.system"), JOB_SYSTEM)); assertThat(task).isNotNull(); testing.waitAndAssertTraces( @@ -105,7 +111,7 @@ void scheduleLambdaTest() throws InterruptedException { List assertions = codeFunctionPrefixAssertions(LambdaTaskConfigurer.class.getName() + "$$Lambda", "run"); - assertions.add(equalTo(AttributeKey.stringKey("job.system"), "spring_scheduling")); + assertions.add(equalTo(AttributeKey.stringKey("job.system"), JOB_SYSTEM)); assertThat(configurer).isNotNull(); testing.waitAndAssertTraces( @@ -127,7 +133,7 @@ void scheduleEnhancedClassTest() throws InterruptedException { List assertions = codeFunctionAssertions(EnhancedClassTaskConfig.class, "run"); - assertions.add(equalTo(AttributeKey.stringKey("job.system"), "spring_scheduling")); + assertions.add(equalTo(AttributeKey.stringKey("job.system"), JOB_SYSTEM)); assertThat(latch).isNotNull(); testing.waitAndAssertTraces( @@ -148,7 +154,7 @@ void taskWithErrorTest() throws InterruptedException { task.blockUntilExecute(); List assertions = codeFunctionAssertions(TaskWithError.class, "run"); - assertions.add(equalTo(AttributeKey.stringKey("job.system"), "spring_scheduling")); + assertions.add(equalTo(AttributeKey.stringKey("job.system"), JOB_SYSTEM)); assertThat(task).isNotNull(); testing.waitAndAssertTraces( diff --git a/instrumentation/spring/spring-scheduling-3.1/metadata.yaml b/instrumentation/spring/spring-scheduling-3.1/metadata.yaml new file mode 100644 index 000000000000..d246e781446e --- /dev/null +++ b/instrumentation/spring/spring-scheduling-3.1/metadata.yaml @@ -0,0 +1,6 @@ +description: This instrumentation enables tracing for Spring Scheduling tasks. +configurations: + - name: otel.instrumentation.spring-scheduling.experimental-span-attributes + description: Adds the experimental span attribute `job.system` with the value `spring_scheduling`. + type: boolean + default: false diff --git a/instrumentation/spring/spring-security-config-6.0/library/build.gradle.kts b/instrumentation/spring/spring-security-config-6.0/library/build.gradle.kts index 368eb0272570..e4ee6cb557c4 100644 --- a/instrumentation/spring/spring-security-config-6.0/library/build.gradle.kts +++ b/instrumentation/spring/spring-security-config-6.0/library/build.gradle.kts @@ -18,3 +18,9 @@ dependencies { otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_17) } + +tasks.test { + systemProperty("metaDataConfig", "otel.instrumentation.common.enduser.id.enabled=true,otel.instrumentation.common.enduser.role.enabled=true,otel.instrumentation.common.enduser.scope.enabled=true") + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) +} diff --git a/instrumentation/spring/spring-security-config-6.0/metadata.yaml b/instrumentation/spring/spring-security-config-6.0/metadata.yaml new file mode 100644 index 000000000000..a009f50b527a --- /dev/null +++ b/instrumentation/spring/spring-security-config-6.0/metadata.yaml @@ -0,0 +1,26 @@ +description: > + This instrumentation does not emit any telemetry on its own. Instead, it captures enduser + attributes, and is only enabled when at least one of the `enduser` configurations is enabled. + + NOTE: The `enduser` attributes have been deprecated and will be removed in 3.0+ of the java agent. +configurations: + - name: otel.instrumentation.common.enduser.id.enabled + description: Enables capturing the enduser.id attribute. + type: boolean + default: false + - name: otel.instrumentation.common.enduser.role.enabled + description: Enables capturing the enduser.role attribute. + type: boolean + default: false + - name: otel.instrumentation.common.enduser.scope.enabled + description: Enables capturing the enduser.scope attribute. + type: boolean + default: false + - name: otel.instrumentation.spring-security.enduser.role.granted-authority-prefix + description: Prefix of granted authorities identifying roles to capture in the `enduser.role` semantic attribute. + type: String + default: "ROLE_" + - name: otel.instrumentation.spring-security.scope.role.granted-authority-prefix + description: Prefix of granted authorities identifying scopes to capture in the `enduser.scopes` semantic attribute. + type: String + default: "SCOPE_" From 3c5fb5d5c47dbe7250e2d14ae41af5f0548b558f Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Mon, 21 Jul 2025 08:53:37 -0400 Subject: [PATCH 05/13] more spring --- instrumentation-docs/collect.sh | 4 +--- .../spring-web/spring-web-3.1/library/build.gradle.kts | 7 +++++++ .../spring/spring-web/spring-web-3.1/metadata.yaml | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 instrumentation/spring/spring-web/spring-web-3.1/metadata.yaml diff --git a/instrumentation-docs/collect.sh b/instrumentation-docs/collect.sh index 721bfe61752f..4c1f9769769d 100755 --- a/instrumentation-docs/collect.sh +++ b/instrumentation-docs/collect.sh @@ -98,10 +98,8 @@ readonly INSTRUMENTATIONS=( # "spring:spring-rmi-4.0:javaagent:test" # "spring:spring-scheduling-3.1:javaagent:test" # "spring:spring-scheduling-3.1:javaagent:testExperimental" - "spring:spring-security-config-6.0:library:test" - - + "spring:spring-web:spring-web-3.1:library:test" ) diff --git a/instrumentation/spring/spring-web/spring-web-3.1/library/build.gradle.kts b/instrumentation/spring/spring-web/spring-web-3.1/library/build.gradle.kts index f852b2dccbcc..adb16fab9342 100644 --- a/instrumentation/spring/spring-web/spring-web-3.1/library/build.gradle.kts +++ b/instrumentation/spring/spring-web/spring-web-3.1/library/build.gradle.kts @@ -19,3 +19,10 @@ if (latestDepTest) { minJavaVersionSupported.set(JavaVersion.VERSION_17) } } + +tasks { + test { + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + } +} diff --git a/instrumentation/spring/spring-web/spring-web-3.1/metadata.yaml b/instrumentation/spring/spring-web/spring-web-3.1/metadata.yaml new file mode 100644 index 000000000000..f11f6201ec4d --- /dev/null +++ b/instrumentation/spring/spring-web/spring-web-3.1/metadata.yaml @@ -0,0 +1,2 @@ +description: This instrumentation provides a library integration that enables capturing HTTP client + spans and metrics for Spring's RestTemplate. The java agent instrumentation From cd76a2bf6ae290c2ca8a2666d7fe3030bcf29695 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Mon, 21 Jul 2025 14:43:22 -0400 Subject: [PATCH 06/13] more spring --- instrumentation-docs/collect.sh | 3 ++- .../spring/spring-web/spring-web-3.1/metadata.yaml | 6 ++++-- .../spring/spring-web/spring-web-6.0/metadata.yaml | 1 + .../spring/spring-webflux/spring-webflux-5.0/metadata.yaml | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 instrumentation/spring/spring-web/spring-web-6.0/metadata.yaml create mode 100644 instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml diff --git a/instrumentation-docs/collect.sh b/instrumentation-docs/collect.sh index 4c1f9769769d..b993b5949d2a 100755 --- a/instrumentation-docs/collect.sh +++ b/instrumentation-docs/collect.sh @@ -99,7 +99,8 @@ readonly INSTRUMENTATIONS=( # "spring:spring-scheduling-3.1:javaagent:test" # "spring:spring-scheduling-3.1:javaagent:testExperimental" - "spring:spring-web:spring-web-3.1:library:test" +# "spring:spring-web:spring-web-3.1:library:test" + "spring:spring-web:spring-web-6.0:javaagent:test" ) diff --git a/instrumentation/spring/spring-web/spring-web-3.1/metadata.yaml b/instrumentation/spring/spring-web/spring-web-3.1/metadata.yaml index f11f6201ec4d..969b249906f4 100644 --- a/instrumentation/spring/spring-web/spring-web-3.1/metadata.yaml +++ b/instrumentation/spring/spring-web/spring-web-3.1/metadata.yaml @@ -1,2 +1,4 @@ -description: This instrumentation provides a library integration that enables capturing HTTP client - spans and metrics for Spring's RestTemplate. The java agent instrumentation +description: > + This instrumentation provides a library integration that enables capturing HTTP client spans and + metrics for Spring's RestTemplate. The agent integration enriches HTTP server spans and metrics + with route information. diff --git a/instrumentation/spring/spring-web/spring-web-6.0/metadata.yaml b/instrumentation/spring/spring-web/spring-web-6.0/metadata.yaml new file mode 100644 index 000000000000..4b044e2b1fdb --- /dev/null +++ b/instrumentation/spring/spring-web/spring-web-6.0/metadata.yaml @@ -0,0 +1 @@ +description: This instrumentation enriches HTTP server spans and metrics with route information. diff --git a/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml b/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml new file mode 100644 index 000000000000..61346e92f22f --- /dev/null +++ b/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml @@ -0,0 +1 @@ +description: From fb81745d9909d58469c2a54536c7397f23f5bff5 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Tue, 22 Jul 2025 06:08:14 -0400 Subject: [PATCH 07/13] more spring --- ...ntelemetry-instrumentation-annotations.txt | 2 +- .../opentelemetry-instrumentation-api.txt | 2 +- instrumentation-docs/collect.sh | 11 ++++++- .../dropwizard-views-0.7/metadata.yaml | 4 +-- .../javaagent/build.gradle.kts | 8 +++-- .../spring-webflux-5.0/metadata.yaml | 9 +++++- .../library/build.gradle.kts | 7 +++++ .../spring-webflux-5.3/metadata.yaml | 3 ++ .../javaagent/build.gradle.kts | 31 +++++++++++++------ .../spring-webmvc-3.1/metadata.yaml | 17 ++++++++++ .../library/build.gradle.kts | 7 +++++ .../spring-webmvc-5.3/metadata.yaml | 4 +++ .../javaagent/build.gradle.kts | 3 ++ .../spring-webmvc-6.0/metadata.yaml | 0 .../boot/AbstractSpringBootBasedTest.java | 13 +++++++- 15 files changed, 102 insertions(+), 19 deletions(-) create mode 100644 instrumentation/spring/spring-webflux/spring-webflux-5.3/metadata.yaml create mode 100644 instrumentation/spring/spring-webmvc/spring-webmvc-3.1/metadata.yaml create mode 100644 instrumentation/spring/spring-webmvc/spring-webmvc-5.3/metadata.yaml create mode 100644 instrumentation/spring/spring-webmvc/spring-webmvc-6.0/metadata.yaml diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt b/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt index 439a9b5ccb5f..99e830449af0 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-instrumentation-annotations-2.18.0-SNAPSHOT.jar against opentelemetry-instrumentation-annotations-2.18.0.jar +Comparing source compatibility of opentelemetry-instrumentation-annotations-2.18.0-SNAPSHOT.jar against opentelemetry-instrumentation-annotations-2.18.1.jar No changes. \ No newline at end of file diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt b/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt index 79292c17b6d4..b3ea99e616e4 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt @@ -1,2 +1,2 @@ -Comparing source compatibility of opentelemetry-instrumentation-api-2.18.0-SNAPSHOT.jar against opentelemetry-instrumentation-api-2.18.0.jar +Comparing source compatibility of opentelemetry-instrumentation-api-2.18.0-SNAPSHOT.jar against opentelemetry-instrumentation-api-2.18.1.jar No changes. \ No newline at end of file diff --git a/instrumentation-docs/collect.sh b/instrumentation-docs/collect.sh index b993b5949d2a..0ffc815d3192 100755 --- a/instrumentation-docs/collect.sh +++ b/instrumentation-docs/collect.sh @@ -100,7 +100,16 @@ readonly INSTRUMENTATIONS=( # "spring:spring-scheduling-3.1:javaagent:testExperimental" # "spring:spring-web:spring-web-3.1:library:test" - "spring:spring-web:spring-web-6.0:javaagent:test" +# "spring:spring-web:spring-web-6.0:javaagent:test" + +# "spring:spring-webflux:spring-webflux-5.0:javaagent:test" +# "spring:spring-webflux:spring-webflux-5.3:library:test" +# "spring:spring-webmvc:spring-webmvc-3.1:javaagent:test" +# "spring:spring-webmvc:spring-webmvc-3.1:javaagent:testExperimental" +# "spring:spring-webmvc:spring-webmvc-5.3:library:test" + + "spring:spring-webmvc:spring-webmvc-6.0:javaagent:test" + # "spring:spring-webmvc:spring-webmvc-3.1:javaagent:testExperimental" ) diff --git a/instrumentation/dropwizard/dropwizard-views-0.7/metadata.yaml b/instrumentation/dropwizard/dropwizard-views-0.7/metadata.yaml index 96cd260f9316..af390acec7fa 100644 --- a/instrumentation/dropwizard/dropwizard-views-0.7/metadata.yaml +++ b/instrumentation/dropwizard/dropwizard-views-0.7/metadata.yaml @@ -1,9 +1,9 @@ configurations: - name: otel.instrumentation.common.experimental.view-telemetry.enabled - description: Enables experimental view telemetry. + description: Enables the creation of experimental view (INTERNAL) spans. type: boolean default: false - name: otel.instrumentation.common.experimental.controller-telemetry.enabled - description: Enables experimental controller telemetry. + description: Enables the creation of experimental controller (INTERNAL) spans. type: boolean default: false diff --git a/instrumentation/spring/spring-webflux/spring-webflux-5.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-webflux/spring-webflux-5.0/javaagent/build.gradle.kts index 5c72229ca019..a8a3ee750155 100644 --- a/instrumentation/spring/spring-webflux/spring-webflux-5.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-webflux/spring-webflux-5.0/javaagent/build.gradle.kts @@ -61,6 +61,8 @@ dependencies { testLibrary("org.springframework.boot:spring-boot-starter-reactor-netty:2.0.0.RELEASE") } +val latestDepTest = findProperty("testLatestDeps") as Boolean + tasks.withType().configureEach { // TODO run tests both with and without experimental span attributes jvmArgs("-Dotel.instrumentation.spring-webflux.experimental-span-attributes=true") @@ -69,12 +71,12 @@ tasks.withType().configureEach { jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") - systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) + systemProperty("metaDataConfig", "otel.instrumentation.common.experimental.controller-telemetry.enabled") + systemProperty("testLatestDeps", latestDepTest) systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) } -val latestDepTest = findProperty("testLatestDeps") as Boolean - if (latestDepTest) { // spring 6 requires java 17 otelJava { diff --git a/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml b/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml index 61346e92f22f..a84476b7aa8f 100644 --- a/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml +++ b/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml @@ -1 +1,8 @@ -description: +description: > + This instrumentation enables HTTP client spans and metrics for Spring WebFlux 5.0. It also + optionally enables experimental controller (INTERNAL) spans. +configuration: + - name: otel.instrumentation.common.experimental.controller-telemetry.enabled + description: Enables the creation of experimental controller (INTERNAL) spans. + type: boolean + default: false diff --git a/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/build.gradle.kts b/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/build.gradle.kts index 1df4b62e1934..79dd2fa4d629 100644 --- a/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/build.gradle.kts +++ b/instrumentation/spring/spring-webflux/spring-webflux-5.3/library/build.gradle.kts @@ -33,3 +33,10 @@ if (!latestDepTest) { } } } + +tasks { + test { + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + } +} diff --git a/instrumentation/spring/spring-webflux/spring-webflux-5.3/metadata.yaml b/instrumentation/spring/spring-webflux/spring-webflux-5.3/metadata.yaml new file mode 100644 index 000000000000..4879f014a113 --- /dev/null +++ b/instrumentation/spring/spring-webflux/spring-webflux-5.3/metadata.yaml @@ -0,0 +1,3 @@ +description: > + This instrumentation provides a library integration for the Spring WebFlux WebClient and Webflux + server versions 5.3+ that enables HTTP client and server spans and metrics. diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/build.gradle.kts b/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/build.gradle.kts index 165c8b343c97..66fb89da2d94 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/build.gradle.kts @@ -43,16 +43,29 @@ dependencies { latestDepTestLibrary("org.springframework.boot:spring-boot-starter-security:2.+") // see spring-webmvc-6.0 module } -tasks.withType().configureEach { - systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) +tasks { + withType().configureEach { + systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) - // TODO run tests both with and without experimental span attributes - jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true") - // required on jdk17 - jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") - jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") - jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") - jvmArgs("-Dotel.instrumentation.common.experimental.view-telemetry.enabled=true") + // required on jdk17 + jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") + jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") + + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + + jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") + jvmArgs("-Dotel.instrumentation.common.experimental.view-telemetry.enabled=true") + } + + val testExperimental by registering(Test::class) { + systemProperty("metaDataConfig", "otel.instrumentation.spring-webmvc.experimental-span-attributes=true") + jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true") + } + + check { + dependsOn(testExperimental) + } } configurations.testRuntimeClasspath { diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/metadata.yaml b/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/metadata.yaml new file mode 100644 index 000000000000..44d7d559e3ed --- /dev/null +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/metadata.yaml @@ -0,0 +1,17 @@ +description: > + This instrumentation enables optional Controller and View (INTERNAL) spans for Spring WebMVC 3.1+. +configurations: + - name: otel.instrumentation.spring-webmvc.experimental-span-attributes + type: boolean + default: false + description: > + Enables the capture of experimental span attributes `spring-webmvc-view-name` and + `spring-webmvc.view.type`. + - name: otel.instrumentation.common.experimental.controller-telemetry.enabled + description: Enables the creation of experimental controller (INTERNAL) spans. + type: boolean + default: false + - name: otel.instrumentation.common.experimental.view-telemetry.enabled + description: Enables the creation of experimental view (INTERNAL) spans. + type: boolean + default: false diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/library/build.gradle.kts b/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/library/build.gradle.kts index be39fee5a4d2..6ab8b90a3373 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/library/build.gradle.kts +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/library/build.gradle.kts @@ -22,3 +22,10 @@ configurations.testRuntimeClasspath { force("org.slf4j:slf4j-api:1.7.36") } } + +tasks { + test { + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + } +} diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/metadata.yaml b/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/metadata.yaml new file mode 100644 index 000000000000..4beb4df459f4 --- /dev/null +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/metadata.yaml @@ -0,0 +1,4 @@ +description: > + This instrumentation provides a library integration for Spring WebMVC controllers, that enables + the creation of HTTP server spans and metrics for requests processed by the Spring servlet + container. diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts index 312b38583aa2..05b30ee06254 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts @@ -53,5 +53,8 @@ tasks.withType().configureEach { jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") jvmArgs("-Dotel.instrumentation.common.experimental.view-telemetry.enabled=true") + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) } diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/metadata.yaml b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/metadata.yaml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-common/testing/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/boot/AbstractSpringBootBasedTest.java b/instrumentation/spring/spring-webmvc/spring-webmvc-common/testing/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/boot/AbstractSpringBootBasedTest.java index 10c2f4cc6289..f4ec82ce4122 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-common/testing/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/boot/AbstractSpringBootBasedTest.java +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-common/testing/src/main/java/io/opentelemetry/instrumentation/spring/webmvc/boot/AbstractSpringBootBasedTest.java @@ -51,6 +51,9 @@ public abstract class AbstractSpringBootBasedTest extends AbstractHttpServerTest { + private static final String EXPERIMENTAL_SPAN_CONFIG = + "otel.instrumentation.spring-webmvc.experimental-span-attributes"; + protected abstract ConfigurableApplicationContext context(); protected abstract Class securityConfigClass(); @@ -177,7 +180,8 @@ protected SpanDataAssert assertRenderSpan( .hasKind(SpanKind.INTERNAL) .hasAttributesSatisfyingExactly( equalTo( - AttributeKey.stringKey("spring-webmvc.view.type"), RedirectView.class.getName())); + AttributeKey.stringKey("spring-webmvc.view.type"), + experimental(RedirectView.class.getName()))); return span; } @@ -208,6 +212,13 @@ protected SpanDataAssert assertHandlerSpan( return span; } + private static String experimental(String value) { + if (!Boolean.getBoolean(EXPERIMENTAL_SPAN_CONFIG)) { + return null; + } + return value; + } + private static String getHandlerSpanName(ServerEndpoint endpoint) { if (QUERY_PARAM.equals(endpoint)) { return "TestController.queryParam"; From e1bbe8ecc722a2821a1c5a3ee1610b8490a7cde2 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Tue, 22 Jul 2025 07:44:12 -0400 Subject: [PATCH 08/13] add descripton for openai --- docs/instrumentation-list.yaml | 701 +++++++++++++++++- instrumentation-docs/collect.sh | 27 +- .../docs/InstrumentationAnalyzer.java | 3 +- .../javaagent/build.gradle.kts | 3 + .../openai/openai-java-1.1/metadata.yaml | 9 + .../spring-webflux-5.0/metadata.yaml | 2 +- .../javaagent/build.gradle.kts | 35 +- .../spring-webmvc-6.0/metadata.yaml | 17 + 8 files changed, 775 insertions(+), 22 deletions(-) create mode 100644 instrumentation/openai/openai-java-1.1/metadata.yaml diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index ce84a39bc10a..3d9a9439dc6a 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -935,7 +935,8 @@ libraries: type: boolean default: false - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - description: Enables experimental receive telemetry for AWS SDK instrumentation. + description: | + Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. type: boolean default: false - name: otel.instrumentation.messaging.experimental.capture-headers @@ -977,7 +978,8 @@ libraries: - software.amazon.awssdk:lambda:2.2.0 configurations: - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - description: Enables experimental receive telemetry for AWS SDK instrumentation. + description: | + Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. type: boolean default: false - name: otel.instrumentation.messaging.experimental.capture-headers @@ -1324,11 +1326,11 @@ libraries: - io.dropwizard:dropwizard-views:(,3.0.0) configurations: - name: otel.instrumentation.common.experimental.view-telemetry.enabled - description: Enables experimental view telemetry. + description: Enables the creation of experimental view (INTERNAL) spans. type: boolean default: false - name: otel.instrumentation.common.experimental.controller-telemetry.enabled - description: Enables experimental controller telemetry. + description: Enables the creation of experimental controller (INTERNAL) spans. type: boolean default: false elasticsearch: @@ -2463,7 +2465,8 @@ libraries: type: list default: '' - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - description: Enables experimental receive telemetry for Kafka instrumentation. + description: | + Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. type: boolean default: false - name: kafka-clients-2.6 @@ -2881,6 +2884,88 @@ libraries: type: STRING - name: server.port type: LONG + openai: + - name: openai-java-1.1 + description: This instrumentation enables Gen AI client spans and metrics for + OpenAI Java SDK 1.1+. + source_path: instrumentation/openai/openai-java-1.1 + scope: + name: io.opentelemetry.openai-java-1.1 + target_versions: + javaagent: + - com.openai:openai-java:[1.1.0,) + library: + - com.openai:openai-java:1.1.0 + configurations: + - name: otel.instrumentation.genai.capture-message-content + description: | + Enables including the full content of user and assistant messages in emitted log events. Note that full content can have data privacy and size concerns, and care should be taken when enabling this. + type: boolean + default: false + telemetry: + - when: default + metrics: + - name: gen_ai.client.operation.duration + description: GenAI operation duration. + type: HISTOGRAM + unit: s + attributes: + - name: gen_ai.operation.name + type: STRING + - name: gen_ai.request.model + type: STRING + - name: gen_ai.response.model + type: STRING + - name: gen_ai.system + type: STRING + - name: gen_ai.client.token.usage + description: Measures number of input and output tokens used. + type: HISTOGRAM + unit: token + attributes: + - name: gen_ai.operation.name + type: STRING + - name: gen_ai.request.model + type: STRING + - name: gen_ai.response.model + type: STRING + - name: gen_ai.system + type: STRING + - name: gen_ai.token.type + type: STRING + spans: + - span_kind: INTERNAL + attributes: + - name: gen_ai.operation.name + type: STRING + - name: gen_ai.request.frequency_penalty + type: DOUBLE + - name: gen_ai.request.max_tokens + type: LONG + - name: gen_ai.request.model + type: STRING + - name: gen_ai.request.presence_penalty + type: DOUBLE + - name: gen_ai.request.seed + type: LONG + - name: gen_ai.request.stop_sequences + type: STRING_ARRAY + - name: gen_ai.request.temperature + type: DOUBLE + - name: gen_ai.request.top_p + type: DOUBLE + - name: gen_ai.response.finish_reasons + type: STRING_ARRAY + - name: gen_ai.response.id + type: STRING + - name: gen_ai.response.model + type: STRING + - name: gen_ai.system + type: STRING + - name: gen_ai.usage.input_tokens + type: LONG + - name: gen_ai.usage.output_tokens + type: LONG opensearch: - name: opensearch-rest-1.0 source_path: instrumentation/opensearch/opensearch-rest-1.0 @@ -3565,6 +3650,7 @@ libraries: - com.sparkjava:spark-core:[2.3,) spring: - name: spring-batch-3.0 + description: Instruments the Spring Batch framework. disabled_by_default: true source_path: instrumentation/spring/spring-batch-3.0 scope: @@ -3572,7 +3658,31 @@ libraries: target_versions: javaagent: - org.springframework.batch:spring-batch-core:[3.0.0.RELEASE,5) + configurations: + - name: otel.instrumentation.spring-batch.experimental-span-attributes + description: Adds the experimental attribute `job.system` to spans. + type: boolean + default: false + - name: otel.instrumentation.spring-batch.experimental.chunk.new-trace + description: When enabled, a new root span will be created for each chunk processing. + Please note that this may lead to a high number of spans being created. + type: boolean + default: false + - name: otel.instrumentation.spring-batch.item.enabled + description: When enabled, spans will be created for each item processed. Please + note that this may lead to a high number of spans being created. + type: boolean + default: false + telemetry: + - when: otel.instrumentation.spring-batch.experimental-span-attributes=true + spans: + - span_kind: INTERNAL + attributes: + - name: job.system + type: STRING - name: spring-boot-actuator-autoconfigure-2.0 + description: | + This instrumentation configures the OpenTelemetry Micrometer bridge to receive metrics from Spring Boot Actuator. It does not produce telemetry on its own. disabled_by_default: true source_path: instrumentation/spring/spring-boot-actuator-autoconfigure-2.0 scope: @@ -3581,10 +3691,14 @@ libraries: javaagent: - org.springframework.boot:spring-boot-actuator-autoconfigure:[2.0.0.RELEASE,) - name: spring-boot-resources + description: | + This instrumentation automatically detects the `service.name` and `service.version` for Spring Boot applications and sets them as resource attributes. source_path: instrumentation/spring/spring-boot-resources scope: name: io.opentelemetry.spring-boot-resources - name: spring-cloud-aws-3.0 + description: | + This instrumentation enhances tracing for Spring Cloud AWS. It augments the existing AWS SDK instrumentation by providing higher-level tracing for SQS operations, capturing details specific to Spring Cloud AWS SQS usage and linking them to the underlying AWS SDK traces. source_path: instrumentation/spring/spring-cloud-aws-3.0 minimum_java_version: 17 scope: @@ -3593,13 +3707,23 @@ libraries: javaagent: - io.awspring.cloud:spring-cloud-aws-sqs:[3.0.0,) - name: spring-cloud-gateway-2.0 + description: | + This instrumentation enhances tracing for Spring Cloud Gateway. It does not generate new telemetry on its own, but rather enriches existing traces produced by other instrumentations like Netty and Spring WebFlux with Spring Cloud Gateway-specific attributes. source_path: instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0 scope: name: io.opentelemetry.spring-cloud-gateway-2.0 target_versions: javaagent: - org.springframework.cloud:spring-cloud-starter-gateway:[2.0.0.RELEASE,] + configurations: + - name: otel.instrumentation.spring-cloud-gateway.experimental-span-attributes + description: | + Enables experimental `spring-cloud-gateway.route` attributes (e.g., `spring-cloud-gateway.route.id`, `spring-cloud-gateway.route.uri`, etc.) on spans. + type: boolean + default: false - name: spring-core-2.0 + description: | + This instrumentation ensures proper context propagation for asynchronous operations within Spring Core. It modifies how tasks are submitted and executed to ensure that spans created by other instrumentations are correctly linked across thread boundaries, rather than generating any new telemetry itself. source_path: instrumentation/spring/spring-core-2.0 minimum_java_version: 17 scope: @@ -3608,6 +3732,8 @@ libraries: javaagent: - org.springframework:spring-core:[2.0,] - name: spring-data-1.8 + description: | + This instrumentation enhances tracing for Spring Data operations. It works in conjunction with other instrumentations, such as JDBC, to provide additional context and details for database interactions initiated through Spring Data. source_path: instrumentation/spring/spring-data/spring-data-1.8 scope: name: io.opentelemetry.spring-data-1.8 @@ -3615,7 +3741,18 @@ libraries: javaagent: - org.springframework:spring-aop:[1.2,] - org.springframework.data:spring-data-commons:[1.8.0.RELEASE,] + telemetry: + - when: default + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING - name: spring-integration-4.1 + description: This instrumentation enables PRODUCER and CONSUMER spans for Spring + Integration. source_path: instrumentation/spring/spring-integration-4.1 scope: name: io.opentelemetry.spring-integration-4.1 @@ -3624,14 +3761,74 @@ libraries: - org.springframework.integration:spring-integration-core:[4.1.0.RELEASE,) library: - org.springframework.integration:spring-integration-core:[4.1.0.RELEASE,5.+) + configurations: + - name: otel.instrumentation.spring-integration.producer.enabled + description: | + Create producer spans when messages are sent to an output channel. Enable when you're using a messaging library that doesn't have its own instrumentation for generating producer spans. Note that the detection of output channels only works for Spring Cloud Stream `DirectWithAttributesChannel`. + type: boolean + default: false + - name: otel.instrumentation.spring-integration.global-channel-interceptor-patterns + description: An array of Spring channel name patterns that will be intercepted. + type: list + default: '*' + - name: otel.instrumentation.messaging.experimental.capture-headers + description: Allows configuring headers to capture as span attributes. + type: list + default: '' + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.header.test_message_header + type: STRING_ARRAY + - name: messaging.operation + type: STRING + - when: otel.instrumentation.spring-integration.producer.enabled=true + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.operation + type: STRING + - span_kind: PRODUCER + attributes: + - name: messaging.operation + type: STRING - name: spring-jms-2.0 + description: This instrumentation enables the generation of CONSUMER spans for + Spring JMS. source_path: instrumentation/spring/spring-jms/spring-jms-2.0 scope: name: io.opentelemetry.spring-jms-2.0 target_versions: javaagent: - org.springframework:spring-jms:[2.0,6) + configurations: + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: | + Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. + type: boolean + default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.destination.name + type: STRING + - name: messaging.message.id + type: STRING + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING - name: spring-jms-6.0 + description: This instrumentation enables the generation of CONSUMER spans for + Spring JMS. source_path: instrumentation/spring/spring-jms/spring-jms-6.0 minimum_java_version: 17 scope: @@ -3639,14 +3836,108 @@ libraries: target_versions: javaagent: - org.springframework:spring-jms:[6.0.0,) + configurations: + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: | + Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. + type: boolean + default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.destination.name + type: STRING + - name: messaging.header.test_message_header + type: STRING_ARRAY + - name: messaging.header.test_message_int_header + type: STRING_ARRAY + - name: messaging.message.id + type: STRING + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING - name: spring-kafka-2.7 + description: This instrumentation enables CONSUMER spans for Spring Kafka listeners. source_path: instrumentation/spring/spring-kafka-2.7 scope: name: io.opentelemetry.spring-kafka-2.7 target_versions: javaagent: - org.springframework.kafka:spring-kafka:[2.7.0,) + configurations: + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: | + Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. + type: boolean + default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + - name: otel.instrumentation.kafka.experimental-span-attributes + description: Enables capturing experimental span attribute `kafka.record.queue_time_ms` + type: boolean + default: false + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.batch.message_count + type: LONG + - name: messaging.client_id + type: STRING + - name: messaging.destination.name + type: STRING + - name: messaging.destination.partition.id + type: STRING + - name: messaging.kafka.consumer.group + type: STRING + - name: messaging.kafka.message.key + type: STRING + - name: messaging.kafka.message.offset + type: LONG + - name: messaging.message.body.size + type: LONG + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING + - when: otel.instrumentation.kafka.experimental-span-attributes=true,otel.instrumentation.messaging.experimental.receive-telemetry.enabled=true + spans: + - span_kind: CONSUMER + attributes: + - name: kafka.record.queue_time_ms + type: LONG + - name: messaging.batch.message_count + type: LONG + - name: messaging.client_id + type: STRING + - name: messaging.destination.name + type: STRING + - name: messaging.destination.partition.id + type: STRING + - name: messaging.kafka.consumer.group + type: STRING + - name: messaging.kafka.message.key + type: STRING + - name: messaging.kafka.message.offset + type: LONG + - name: messaging.message.body.size + type: LONG + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING - name: spring-pulsar-1.0 + description: This instrumentation enables CONSUMER spans for Spring Pulsar listeners. source_path: instrumentation/spring/spring-pulsar-1.0 minimum_java_version: 17 scope: @@ -3654,28 +3945,143 @@ libraries: target_versions: javaagent: - org.springframework.pulsar:spring-pulsar:[1.0.0,) + configurations: + - name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled + description: | + Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. + type: boolean + default: false + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + - name: otel.instrumentation.pulsar.experimental-span-attributes + description: | + Enables capturing experimental span attribute `messaging.pulsar.message.type` on PRODUCER spans. + type: boolean + default: false + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.destination.name + type: STRING + - name: messaging.message.body.size + type: LONG + - name: messaging.message.id + type: STRING + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING + - when: otel.instrumentation.pulsar.experimental-span-attributes=true + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.destination.name + type: STRING + - name: messaging.message.body.size + type: LONG + - name: messaging.message.id + type: STRING + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING - name: spring-rabbit-1.0 + description: This instrumentation enables CONSUMER spans for Spring RabbitMQ listeners. source_path: instrumentation/spring/spring-rabbit-1.0 scope: name: io.opentelemetry.spring-rabbit-1.0 target_versions: javaagent: - org.springframework.amqp:spring-rabbit:(,) + configurations: + - name: otel.instrumentation.messaging.experimental.capture-headers + description: A comma-separated list of header names to capture as span attributes. + type: list + default: '' + telemetry: + - when: default + spans: + - span_kind: CONSUMER + attributes: + - name: messaging.destination.name + type: STRING + - name: messaging.header.test_message_header + type: STRING_ARRAY + - name: messaging.message.body.size + type: LONG + - name: messaging.operation + type: STRING + - name: messaging.system + type: STRING - name: spring-rmi-4.0 + description: This instrumentation enables CLIENT and SERVER spans for Spring RMI + applications. source_path: instrumentation/spring/spring-rmi-4.0 scope: name: io.opentelemetry.spring-rmi-4.0 target_versions: javaagent: - org.springframework:spring-context:[4.0.0.RELEASE,6) + telemetry: + - when: default + spans: + - span_kind: CLIENT + attributes: + - name: rpc.method + type: STRING + - name: rpc.service + type: STRING + - name: rpc.system + type: STRING + - span_kind: SERVER + attributes: + - name: rpc.method + type: STRING + - name: rpc.service + type: STRING + - name: rpc.system + type: STRING - name: spring-scheduling-3.1 + description: This instrumentation enables tracing for Spring Scheduling tasks. source_path: instrumentation/spring/spring-scheduling-3.1 scope: name: io.opentelemetry.spring-scheduling-3.1 target_versions: javaagent: - org.springframework:spring-context:[3.1.0.RELEASE,] + configurations: + - name: otel.instrumentation.spring-scheduling.experimental-span-attributes + description: Adds the experimental span attribute `job.system` with the value + `spring_scheduling`. + type: boolean + default: false + telemetry: + - when: default + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING + - when: otel.instrumentation.spring-scheduling.experimental-span-attributes=true + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING + - name: job.system + type: STRING - name: spring-security-config-6.0 + description: | + This instrumentation does not emit any telemetry on its own. Instead, it captures enduser attributes, and is only enabled when at least one of the `enduser` configurations is enabled. + NOTE: The `enduser` attributes have been deprecated and will be removed in 3.0+ of the java agent. source_path: instrumentation/spring/spring-security-config-6.0 minimum_java_version: 17 scope: @@ -3689,14 +4095,72 @@ libraries: - org.springframework:spring-web:6.0.0 - jakarta.servlet:jakarta.servlet-api:6.0.0 - org.springframework.security:spring-security-web:6.0.0 + configurations: + - name: otel.instrumentation.common.enduser.id.enabled + description: Enables capturing the enduser.id attribute. + type: boolean + default: false + - name: otel.instrumentation.common.enduser.role.enabled + description: Enables capturing the enduser.role attribute. + type: boolean + default: false + - name: otel.instrumentation.common.enduser.scope.enabled + description: Enables capturing the enduser.scope attribute. + type: boolean + default: false + - name: otel.instrumentation.spring-security.enduser.role.granted-authority-prefix + description: Prefix of granted authorities identifying roles to capture in the + `enduser.role` semantic attribute. + type: string + default: ROLE_ + - name: otel.instrumentation.spring-security.scope.role.granted-authority-prefix + description: Prefix of granted authorities identifying scopes to capture in + the `enduser.scopes` semantic attribute. + type: string + default: SCOPE_ - name: spring-web-3.1 + description: | + This instrumentation provides a library integration that enables capturing HTTP client spans and metrics for Spring's RestTemplate. The agent integration enriches HTTP server spans and metrics with route information. source_path: instrumentation/spring/spring-web/spring-web-3.1 scope: name: io.opentelemetry.spring-web-3.1 target_versions: javaagent: - org.springframework:spring-web:[3.1.0.RELEASE,6) + telemetry: + - when: default + metrics: + - name: http.client.request.duration + description: Duration of HTTP client requests. + type: HISTOGRAM + unit: s + attributes: + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: server.address + type: STRING + - name: server.port + type: LONG + spans: + - span_kind: CLIENT + attributes: + - name: error.type + type: STRING + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: server.address + type: STRING + - name: server.port + type: LONG + - name: url.full + type: STRING - name: spring-web-6.0 + description: This instrumentation enriches HTTP server spans and metrics with + route information. source_path: instrumentation/spring/spring-web/spring-web-6.0 scope: name: io.opentelemetry.spring-web-6.0 @@ -3704,6 +4168,8 @@ libraries: javaagent: - org.springframework:spring-web:[6.0.0,) - name: spring-webflux-5.0 + description: | + This instrumentation enables HTTP client spans and metrics for Spring WebFlux 5.0. It also optionally enables experimental controller (INTERNAL) spans. source_path: instrumentation/spring/spring-webflux/spring-webflux-5.0 scope: name: io.opentelemetry.spring-webflux-5.0 @@ -3712,8 +4178,13 @@ libraries: - io.projectreactor.ipc:reactor-netty:[0.7.0.RELEASE,) - org.springframework:spring-webflux:[5.0.0.RELEASE,) - io.projectreactor.netty:reactor-netty:[0.8.0.RELEASE,) + configurations: + - name: otel.instrumentation.common.experimental.controller-telemetry.enabled + description: Enables the creation of experimental controller (INTERNAL) spans. + type: boolean + default: false telemetry: - - when: default + - when: otel.instrumentation.common.experimental.controller-telemetry.enabled metrics: - name: http.client.request.duration description: Duration of HTTP client requests. @@ -3728,25 +4199,210 @@ libraries: type: STRING - name: server.port type: LONG + spans: + - span_kind: CLIENT + attributes: + - name: error.type + type: STRING + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: server.address + type: STRING + - name: server.port + type: LONG + - name: url.full + type: STRING + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING - name: spring-webflux-5.3 + description: | + This instrumentation provides a library integration for the Spring WebFlux WebClient and Webflux server versions 5.3+ that enables HTTP client and server spans and metrics. source_path: instrumentation/spring/spring-webflux/spring-webflux-5.3 scope: name: io.opentelemetry.spring-webflux-5.3 target_versions: library: - org.springframework:spring-webflux:5.3.0 + telemetry: + - when: default + metrics: + - name: http.client.request.duration + description: Duration of HTTP client requests. + type: HISTOGRAM + unit: s + attributes: + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: server.address + type: STRING + - name: server.port + type: LONG + - 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: url.scheme + type: STRING + spans: + - span_kind: CLIENT + attributes: + - name: error.type + type: STRING + - name: http.request.method + type: STRING + - name: http.response.status_code + type: LONG + - name: server.address + type: STRING + - name: server.port + type: LONG + - name: url.full + type: STRING + - 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: 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: spring-webmvc-3.1 + description: | + This instrumentation enables optional Controller and View (INTERNAL) spans for Spring WebMVC 3.1+. source_path: instrumentation/spring/spring-webmvc/spring-webmvc-3.1 scope: name: io.opentelemetry.spring-webmvc-3.1 target_versions: javaagent: - org.springframework:spring-webmvc:[3.1.0.RELEASE,6) + configurations: + - name: otel.instrumentation.spring-webmvc.experimental-span-attributes + description: | + Enables the capture of experimental span attributes `spring-webmvc-view-name` and `spring-webmvc.view.type`. + type: boolean + default: false + - name: otel.instrumentation.common.experimental.controller-telemetry.enabled + description: Enables the creation of experimental controller (INTERNAL) spans. + type: boolean + default: false + - name: otel.instrumentation.common.experimental.view-telemetry.enabled + description: Enables the creation of experimental view (INTERNAL) spans. + type: boolean + default: false + telemetry: + - when: default + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING + - when: otel.instrumentation.spring-webmvc.experimental-span-attributes=true + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING + - name: spring-webmvc.view.type + type: STRING - name: spring-webmvc-5.3 + description: | + This instrumentation provides a library integration for Spring WebMVC controllers, that enables the creation of HTTP server spans and metrics for requests processed by the Spring servlet container. source_path: instrumentation/spring/spring-webmvc/spring-webmvc-5.3 scope: name: io.opentelemetry.spring-webmvc-5.3 + 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.request.method_original + 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 - name: spring-webmvc-6.0 + description: | + This instrumentation enables optional Controller and View (INTERNAL) spans for Spring WebMVC 6.0+. source_path: instrumentation/spring/spring-webmvc/spring-webmvc-6.0 minimum_java_version: 17 scope: @@ -3754,6 +4410,39 @@ libraries: target_versions: javaagent: - org.springframework:spring-webmvc:[6.0.0,) + configurations: + - name: otel.instrumentation.spring-webmvc.experimental-span-attributes + description: | + Enables the capture of experimental span attributes `spring-webmvc-view-name` and `spring-webmvc.view.type`. + type: boolean + default: false + - name: otel.instrumentation.common.experimental.controller-telemetry.enabled + description: Enables the creation of experimental controller (INTERNAL) spans. + type: boolean + default: false + - name: otel.instrumentation.common.experimental.view-telemetry.enabled + description: Enables the creation of experimental view (INTERNAL) spans. + type: boolean + default: false + telemetry: + - when: default + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING + - when: otel.instrumentation.spring-webmvc.experimental-span-attributes=true + spans: + - span_kind: INTERNAL + attributes: + - name: code.function + type: STRING + - name: code.namespace + type: STRING + - name: spring-webmvc.view.type + type: STRING - name: spring-ws-2.0 disabled_by_default: true source_path: instrumentation/spring/spring-ws-2.0 diff --git a/instrumentation-docs/collect.sh b/instrumentation-docs/collect.sh index ad614060ddb2..ba3ad6f04b4a 100755 --- a/instrumentation-docs/collect.sh +++ b/instrumentation-docs/collect.sh @@ -90,6 +90,31 @@ readonly INSTRUMENTATIONS=( "apache-dubbo-2.7:javaagent:testDubbo" "finagle-http-23.11:javaagent:test" "finatra-2.9:javaagent:test" + "spring:spring-batch-3.0:javaagent:test" + "spring:spring-data:spring-data-1.8:javaagent:test" + "spring:spring-integration-4.1:javaagent:test" + "spring:spring-integration-4.1:javaagent:testWithRabbitInstrumentation" + "spring:spring-integration-4.1:javaagent:testWithProducerInstrumentation" + "spring:spring-jms:spring-jms-2.0:javaagent:test" + "spring:spring-kafka-2.7:javaagent:test" + "spring:spring-kafka-2.7:javaagent:testNoReceiveTelemetry" + "spring:spring-pulsar-1.0:javaagent:test" + "spring:spring-rabbit-1.0:javaagent:test" + "spring:spring-rmi-4.0:javaagent:test" + "spring:spring-scheduling-3.1:javaagent:test" + "spring:spring-scheduling-3.1:javaagent:testExperimental" + "spring:spring-web:spring-web-3.1:library:test" + "spring:spring-web:spring-web-6.0:javaagent:test" + "spring:spring-webflux:spring-webflux-5.0:javaagent:test" + "spring:spring-webflux:spring-webflux-5.3:library:test" + "spring:spring-webmvc:spring-webmvc-3.1:javaagent:test" + "spring:spring-webmvc:spring-webmvc-3.1:javaagent:testExperimental" + "spring:spring-webmvc:spring-webmvc-5.3:library:test" + "spring:spring-webmvc:spring-webmvc-6.0:javaagent:test" + "spring:spring-webmvc:spring-webmvc-3.1:javaagent:testExperimental" + "spring:spring-webmvc:spring-webmvc-6.0:javaagent:test" + "spring:spring-webmvc:spring-webmvc-6.0:javaagent:testExperimental" + "openai:openai-java-1.1:javaagent:test" ) readonly COLIMA_INSTRUMENTATIONS=( @@ -221,7 +246,7 @@ run_gradle_tasks() { ./gradlew "${tasks[@]}" \ -PcollectMetadata=true \ - --rerun-tasks --continue + --rerun-tasks --continue --no-parallel } # Cleans any stray .telemetry directories left in the repo. diff --git a/instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/InstrumentationAnalyzer.java b/instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/InstrumentationAnalyzer.java index 38cee23f1be0..ad393200fd6b 100644 --- a/instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/InstrumentationAnalyzer.java +++ b/instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/InstrumentationAnalyzer.java @@ -6,6 +6,7 @@ package io.opentelemetry.instrumentation.docs; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.exc.MismatchedInputException; import com.fasterxml.jackson.databind.exc.ValueInstantiationException; import io.opentelemetry.instrumentation.docs.internal.InstrumentationMetaData; import io.opentelemetry.instrumentation.docs.internal.InstrumentationModule; @@ -76,7 +77,7 @@ private InstrumentationMetaData getMetadata(InstrumentationModule module) } try { return YamlHelper.metaDataParser(metadataFile); - } catch (ValueInstantiationException e) { + } catch (ValueInstantiationException | MismatchedInputException e) { logger.severe("Error parsing metadata file for " + module.getInstrumentationName()); throw e; } diff --git a/instrumentation/openai/openai-java-1.1/javaagent/build.gradle.kts b/instrumentation/openai/openai-java-1.1/javaagent/build.gradle.kts index aad02ee8eb2c..455a3456f0c3 100644 --- a/instrumentation/openai/openai-java-1.1/javaagent/build.gradle.kts +++ b/instrumentation/openai/openai-java-1.1/javaagent/build.gradle.kts @@ -25,6 +25,9 @@ tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) // TODO run tests both with and without genai message capture + systemProperty("otel.instrumentation.genai.capture-message-content", "true") + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) } } diff --git a/instrumentation/openai/openai-java-1.1/metadata.yaml b/instrumentation/openai/openai-java-1.1/metadata.yaml new file mode 100644 index 000000000000..f1f6cc9dcd50 --- /dev/null +++ b/instrumentation/openai/openai-java-1.1/metadata.yaml @@ -0,0 +1,9 @@ +description: This instrumentation enables Gen AI client spans and metrics for OpenAI Java SDK 1.1+. +configurations: + - name: otel.instrumentation.genai.capture-message-content + type: boolean + default: false + description: > + Enables including the full content of user and assistant messages in emitted log events. + Note that full content can have data privacy and size concerns, and care should be taken when + enabling this. diff --git a/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml b/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml index a84476b7aa8f..630264ea798f 100644 --- a/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml +++ b/instrumentation/spring/spring-webflux/spring-webflux-5.0/metadata.yaml @@ -1,7 +1,7 @@ description: > This instrumentation enables HTTP client spans and metrics for Spring WebFlux 5.0. It also optionally enables experimental controller (INTERNAL) spans. -configuration: +configurations: - name: otel.instrumentation.common.experimental.controller-telemetry.enabled description: Enables the creation of experimental controller (INTERNAL) spans. type: boolean diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts index 05b30ee06254..d5a9a3c81493 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts @@ -44,17 +44,26 @@ otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_17) } -tasks.withType().configureEach { - // TODO run tests both with and without experimental span attributes - jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true") - // required on jdk17 - jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") - jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") - jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") - jvmArgs("-Dotel.instrumentation.common.experimental.view-telemetry.enabled=true") - - systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") - systemProperty("collectSpans", true) - - systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) +tasks { + withType().configureEach { + // required on jdk17 + jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") + jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") + jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") + jvmArgs("-Dotel.instrumentation.common.experimental.view-telemetry.enabled=true") + + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + systemProperty("collectSpans", true) + + systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) + } + + val testExperimental by registering(Test::class) { + systemProperty("metaDataConfig", "otel.instrumentation.spring-webmvc.experimental-span-attributes=true") + jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true") + } + + check { + dependsOn(testExperimental) + } } diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/metadata.yaml b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/metadata.yaml index e69de29bb2d1..a38d74b6f05d 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/metadata.yaml +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/metadata.yaml @@ -0,0 +1,17 @@ +description: > + This instrumentation enables optional Controller and View (INTERNAL) spans for Spring WebMVC 6.0+. +configurations: + - name: otel.instrumentation.spring-webmvc.experimental-span-attributes + type: boolean + default: false + description: > + Enables the capture of experimental span attributes `spring-webmvc-view-name` and + `spring-webmvc.view.type`. + - name: otel.instrumentation.common.experimental.controller-telemetry.enabled + description: Enables the creation of experimental controller (INTERNAL) spans. + type: boolean + default: false + - name: otel.instrumentation.common.experimental.view-telemetry.enabled + description: Enables the creation of experimental view (INTERNAL) spans. + type: boolean + default: false From 5abc6578a4e2a836120097779304810a328b19e7 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Tue, 22 Jul 2025 08:36:17 -0400 Subject: [PATCH 09/13] fix --- docs/instrumentation-list.yaml | 11 ++++++----- instrumentation/spring/spring-batch-3.0/metadata.yaml | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index 3d9a9439dc6a..19c6cd79eb7f 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -3650,7 +3650,8 @@ libraries: - com.sparkjava:spark-core:[2.3,) spring: - name: spring-batch-3.0 - description: Instruments the Spring Batch framework. + description: This instrumentation enables INTERNAL spans for jobs run by the Spring + Batch framework. disabled_by_default: true source_path: instrumentation/spring/spring-batch-3.0 scope: @@ -3886,10 +3887,12 @@ libraries: type: boolean default: false telemetry: - - when: default + - when: otel.instrumentation.kafka.experimental-span-attributes=true spans: - span_kind: CONSUMER attributes: + - name: kafka.record.queue_time_ms + type: LONG - name: messaging.batch.message_count type: LONG - name: messaging.client_id @@ -3910,12 +3913,10 @@ libraries: type: STRING - name: messaging.system type: STRING - - when: otel.instrumentation.kafka.experimental-span-attributes=true,otel.instrumentation.messaging.experimental.receive-telemetry.enabled=true + - when: default spans: - span_kind: CONSUMER attributes: - - name: kafka.record.queue_time_ms - type: LONG - name: messaging.batch.message_count type: LONG - name: messaging.client_id diff --git a/instrumentation/spring/spring-batch-3.0/metadata.yaml b/instrumentation/spring/spring-batch-3.0/metadata.yaml index 2916fdc2854d..ee9d0349927c 100644 --- a/instrumentation/spring/spring-batch-3.0/metadata.yaml +++ b/instrumentation/spring/spring-batch-3.0/metadata.yaml @@ -1,5 +1,5 @@ disabled_by_default: true -description: Instruments the Spring Batch framework. +description: This instrumentation enables INTERNAL spans for jobs run by the Spring Batch framework. configurations: - name: otel.instrumentation.spring-batch.experimental-span-attributes type: boolean From 7444fdae53d726a12296c3e51221d49652571ad3 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Tue, 22 Jul 2025 08:44:00 -0400 Subject: [PATCH 10/13] fix --- instrumentation/spring/README.md | 2 +- .../spring-cloud-aws-3.0/javaagent/build.gradle.kts | 8 -------- .../spring-integration-4.1/javaagent/build.gradle.kts | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/instrumentation/spring/README.md b/instrumentation/spring/README.md index 053764aa18d1..09ccc44545bc 100644 --- a/instrumentation/spring/README.md +++ b/instrumentation/spring/README.md @@ -17,5 +17,5 @@ This package streamlines the manual instrumentation process of OpenTelemetry for | `otel.instrumentation.spring-scheduling.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes for Spring Scheduling version 3.1. | | `otel.instrumentation.spring-webflux.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes for Spring WebFlux version 5.0. | | `otel.instrumentation.spring-webmvc.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes for Spring Web MVC version 3.1. | -| `otel.instrumentation.messaging.experimental.receive-telemetry.enabled` | Boolean | `false` | Enables experimental receive telemetry for Spring JMS instrumentation. | +| `otel.instrumentation.messaging.experimental.receive-telemetry.enabled` | Boolean | `false` | Enables experimental receive telemetry, which will cause consumers to start a new trace, with only a span link connecting it to the producer trace. | | `otel.instrumentation.kafka.experimental-span-attributes` | Boolean | `false` | Enable the capture of experimental span attributes for Spring Kafka version 2.7. | diff --git a/instrumentation/spring/spring-cloud-aws-3.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-cloud-aws-3.0/javaagent/build.gradle.kts index 6d44377b18f4..2e1aac948038 100644 --- a/instrumentation/spring/spring-cloud-aws-3.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-cloud-aws-3.0/javaagent/build.gradle.kts @@ -26,11 +26,3 @@ dependencies { otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_17) } - -tasks { - test { - // only generates spans from io.opentelemetry.aws-sdk-2.2 scope - systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") - systemProperty("collectSpans", true) - } -} diff --git a/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts b/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts index 08bbb64cc403..33c848261c99 100644 --- a/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts @@ -48,7 +48,7 @@ tasks { include("**/SpringIntegrationAndRabbitTest.*") jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=true") jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=true") - systemProperty("metaDataConfig", "otel.instrumentation.rabbitmq.enabled=true,otel.instrumentation.spring-rabbit.enabled=true") + systemProperty("metaDataConfig", "otel.instrumentation.spring-rabbit.enabled=true") } val testWithProducerInstrumentation by registering(Test::class) { From cec31de4d5fd2da5de03acdf0385869d48a6008f Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Wed, 23 Jul 2025 06:21:39 -0400 Subject: [PATCH 11/13] review updates --- docs/instrumentation-list.yaml | 9 +++++++++ .../spring/spring-boot-autoconfigure/README.md | 2 +- .../spring/spring-boot-autoconfigure/metadata.yaml | 2 +- .../spring/spring-boot-resources/metadata.yaml | 11 +++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index 19c6cd79eb7f..d504e99adc50 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -3694,6 +3694,15 @@ libraries: - name: spring-boot-resources description: | This instrumentation automatically detects the `service.name` and `service.version` for Spring Boot applications and sets them as resource attributes. + It uses the following strategies (first successful wins): + - Check for the SPRING_APPLICATION_NAME environment variable + - Check for spring.application.name system property + - Check for application.properties file on the classpath + - Check for application.properties in the current working dir + - Check for application.yml on the classpath + - Check for application.yml in the current working dir + - Check for --spring.application.name program argument (not jvm arg) via ProcessHandle + - Check for --spring.application.name program argument via sun.java.command system property source_path: instrumentation/spring/spring-boot-resources scope: name: io.opentelemetry.spring-boot-resources diff --git a/instrumentation/spring/spring-boot-autoconfigure/README.md b/instrumentation/spring/spring-boot-autoconfigure/README.md index c82ff7f2ac4b..b96b77c069d8 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/README.md +++ b/instrumentation/spring/spring-boot-autoconfigure/README.md @@ -4,6 +4,6 @@ Auto-configures OpenTelemetry instrumentation for [spring-web](../spring-web/spr , [spring-webmvc](../spring-webmvc/spring-webmvc-5.3/library), and [spring-webflux](../spring-webflux/spring-webflux-5.3/library). Leverages Spring Aspect Oriented Programming, dependency injection, and bean post-processing to trace spring applications. To include -all features listed below use the [opentelemetry-spring-boot-starter](../starters/spring-boot-starter/README.md). +all features listed below use the [opentelemetry-spring-boot-starter](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/). Documentation for OpenTelemetry Spring Auto-Configuration can be found [here](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/out-of-the-box-instrumentation/). diff --git a/instrumentation/spring/spring-boot-autoconfigure/metadata.yaml b/instrumentation/spring/spring-boot-autoconfigure/metadata.yaml index ac354f761c66..5a9cc7af0fc6 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/metadata.yaml +++ b/instrumentation/spring/spring-boot-autoconfigure/metadata.yaml @@ -1,4 +1,4 @@ description: > This instrumentation auto-configures OpenTelemetry instrumentation for spring-web, spring-webmvc, and spring-webflux to instrument Spring Boot applications. It does not produce telemetry on its - own. + own. This instrumentation is mostly used as part of the Spring Boot starter. diff --git a/instrumentation/spring/spring-boot-resources/metadata.yaml b/instrumentation/spring/spring-boot-resources/metadata.yaml index 74ddcf379b2e..daab5c47f19e 100644 --- a/instrumentation/spring/spring-boot-resources/metadata.yaml +++ b/instrumentation/spring/spring-boot-resources/metadata.yaml @@ -1,3 +1,14 @@ description: > This instrumentation automatically detects the `service.name` and `service.version` for Spring Boot applications and sets them as resource attributes. + + It uses the following strategies (first successful wins): + - Check for the SPRING_APPLICATION_NAME environment variable + - Check for spring.application.name system property + - Check for application.properties file on the classpath + - Check for application.properties in the current working dir + - Check for application.yml on the classpath + - Check for application.yml in the current working dir + - Check for --spring.application.name program argument (not jvm arg) via ProcessHandle + - Check for --spring.application.name program argument via sun.java.command system property + From fb4313edadb3a321c061272235f1cdd54928adb0 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Wed, 23 Jul 2025 06:25:59 -0400 Subject: [PATCH 12/13] remove test attributes --- docs/instrumentation-list.yaml | 8 -------- .../instrumentation/docs/parsers/SpanParser.java | 3 ++- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index d504e99adc50..f75bfa8424ac 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -3790,8 +3790,6 @@ libraries: spans: - span_kind: CONSUMER attributes: - - name: messaging.header.test_message_header - type: STRING_ARRAY - name: messaging.operation type: STRING - when: otel.instrumentation.spring-integration.producer.enabled=true @@ -3863,10 +3861,6 @@ libraries: attributes: - name: messaging.destination.name type: STRING - - name: messaging.header.test_message_header - type: STRING_ARRAY - - name: messaging.header.test_message_int_header - type: STRING_ARRAY - name: messaging.message.id type: STRING - name: messaging.operation @@ -4019,8 +4013,6 @@ libraries: attributes: - name: messaging.destination.name type: STRING - - name: messaging.header.test_message_header - type: STRING_ARRAY - name: messaging.message.body.size type: LONG - name: messaging.operation diff --git a/instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/parsers/SpanParser.java b/instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/parsers/SpanParser.java index 02f8a8d636f2..cd4b3fd71362 100644 --- a/instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/parsers/SpanParser.java +++ b/instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/parsers/SpanParser.java @@ -24,7 +24,8 @@ public class SpanParser { // We want to ignore test related attributes - private static final List EXCLUDED_ATTRIBUTES = List.of("x-test-", "test-baggage-"); + private static final List EXCLUDED_ATTRIBUTES = + List.of("x-test-", "test-baggage-", "test_message"); /** * Pull spans from the `.telemetry` directory, filter them by scope, and set them in the module. From bf5c0897a364d9a896a6d630a7b1ff4100b50a25 Mon Sep 17 00:00:00 2001 From: Jay DeLuca Date: Thu, 24 Jul 2025 06:55:25 -0400 Subject: [PATCH 13/13] pull in kafka spelling fix --- docs/instrumentation-list.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/instrumentation-list.yaml b/docs/instrumentation-list.yaml index f75bfa8424ac..a27e3541d883 100644 --- a/docs/instrumentation-list.yaml +++ b/docs/instrumentation-list.yaml @@ -2471,7 +2471,7 @@ libraries: default: false - name: kafka-clients-2.6 description: | - This instrumentation provides a library integeration that enables messaging spans and metrics for Apache Kafka 2.6+ clients. + This instrumentation provides a library integration that enables messaging spans and metrics for Apache Kafka 2.6+ clients. source_path: instrumentation/kafka/kafka-clients/kafka-clients-2.6 scope: name: io.opentelemetry.kafka-clients-2.6