Add descriptions and metadata for spring modules (#14309)

This commit is contained in:
Jay DeLuca 2025-07-30 15:30:12 -04:00 committed by GitHub
parent 3093a4f411
commit ff91c28d20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
59 changed files with 1171 additions and 69 deletions

View File

@ -935,7 +935,8 @@ libraries:
type: boolean type: boolean
default: false default: false
- name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - 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 type: boolean
default: false default: false
- name: otel.instrumentation.messaging.experimental.capture-headers - name: otel.instrumentation.messaging.experimental.capture-headers
@ -977,7 +978,8 @@ libraries:
- software.amazon.awssdk:lambda:2.2.0 - software.amazon.awssdk:lambda:2.2.0
configurations: configurations:
- name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - 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 type: boolean
default: false default: false
- name: otel.instrumentation.messaging.experimental.capture-headers - name: otel.instrumentation.messaging.experimental.capture-headers
@ -1324,11 +1326,11 @@ libraries:
- io.dropwizard:dropwizard-views:(,3.0.0) - io.dropwizard:dropwizard-views:(,3.0.0)
configurations: configurations:
- name: otel.instrumentation.common.experimental.view-telemetry.enabled - name: otel.instrumentation.common.experimental.view-telemetry.enabled
description: Enables experimental view telemetry. description: Enables the creation of experimental view (INTERNAL) spans.
type: boolean type: boolean
default: false default: false
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled - name: otel.instrumentation.common.experimental.controller-telemetry.enabled
description: Enables experimental controller telemetry. description: Enables the creation of experimental controller (INTERNAL) spans.
type: boolean type: boolean
default: false default: false
elasticsearch: elasticsearch:
@ -2463,12 +2465,13 @@ libraries:
type: list type: list
default: '' default: ''
- name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - 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 type: boolean
default: false default: false
- name: kafka-clients-2.6 - name: kafka-clients-2.6
description: | 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 source_path: instrumentation/kafka/kafka-clients/kafka-clients-2.6
scope: scope:
name: io.opentelemetry.kafka-clients-2.6 name: io.opentelemetry.kafka-clients-2.6
@ -2881,6 +2884,88 @@ libraries:
type: STRING type: STRING
- name: server.port - name: server.port
type: LONG 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: opensearch:
- name: opensearch-rest-1.0 - name: opensearch-rest-1.0
source_path: instrumentation/opensearch/opensearch-rest-1.0 source_path: instrumentation/opensearch/opensearch-rest-1.0
@ -3565,6 +3650,8 @@ libraries:
- com.sparkjava:spark-core:[2.3,) - com.sparkjava:spark-core:[2.3,)
spring: spring:
- name: spring-batch-3.0 - name: spring-batch-3.0
description: This instrumentation enables INTERNAL spans for jobs run by the Spring
Batch framework.
disabled_by_default: true disabled_by_default: true
source_path: instrumentation/spring/spring-batch-3.0 source_path: instrumentation/spring/spring-batch-3.0
scope: scope:
@ -3572,7 +3659,31 @@ libraries:
target_versions: target_versions:
javaagent: javaagent:
- org.springframework.batch:spring-batch-core:[3.0.0.RELEASE,5) - 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 - 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 disabled_by_default: true
source_path: instrumentation/spring/spring-boot-actuator-autoconfigure-2.0 source_path: instrumentation/spring/spring-boot-actuator-autoconfigure-2.0
scope: scope:
@ -3581,10 +3692,23 @@ libraries:
javaagent: javaagent:
- org.springframework.boot:spring-boot-actuator-autoconfigure:[2.0.0.RELEASE,) - org.springframework.boot:spring-boot-actuator-autoconfigure:[2.0.0.RELEASE,)
- name: spring-boot-resources - 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 source_path: instrumentation/spring/spring-boot-resources
scope: scope:
name: io.opentelemetry.spring-boot-resources name: io.opentelemetry.spring-boot-resources
- name: spring-cloud-aws-3.0 - 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 source_path: instrumentation/spring/spring-cloud-aws-3.0
minimum_java_version: 17 minimum_java_version: 17
scope: scope:
@ -3593,13 +3717,23 @@ libraries:
javaagent: javaagent:
- io.awspring.cloud:spring-cloud-aws-sqs:[3.0.0,) - io.awspring.cloud:spring-cloud-aws-sqs:[3.0.0,)
- name: spring-cloud-gateway-2.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 source_path: instrumentation/spring/spring-cloud-gateway/spring-cloud-gateway-2.0
scope: scope:
name: io.opentelemetry.spring-cloud-gateway-2.0 name: io.opentelemetry.spring-cloud-gateway-2.0
target_versions: target_versions:
javaagent: javaagent:
- org.springframework.cloud:spring-cloud-starter-gateway:[2.0.0.RELEASE,] - 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 - 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 source_path: instrumentation/spring/spring-core-2.0
minimum_java_version: 17 minimum_java_version: 17
scope: scope:
@ -3608,6 +3742,8 @@ libraries:
javaagent: javaagent:
- org.springframework:spring-core:[2.0,] - org.springframework:spring-core:[2.0,]
- name: spring-data-1.8 - 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 source_path: instrumentation/spring/spring-data/spring-data-1.8
scope: scope:
name: io.opentelemetry.spring-data-1.8 name: io.opentelemetry.spring-data-1.8
@ -3615,7 +3751,18 @@ libraries:
javaagent: javaagent:
- org.springframework:spring-aop:[1.2,] - org.springframework:spring-aop:[1.2,]
- org.springframework.data:spring-data-commons:[1.8.0.RELEASE,] - 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 - name: spring-integration-4.1
description: This instrumentation enables PRODUCER and CONSUMER spans for Spring
Integration.
source_path: instrumentation/spring/spring-integration-4.1 source_path: instrumentation/spring/spring-integration-4.1
scope: scope:
name: io.opentelemetry.spring-integration-4.1 name: io.opentelemetry.spring-integration-4.1
@ -3624,14 +3771,72 @@ libraries:
- org.springframework.integration:spring-integration-core:[4.1.0.RELEASE,) - org.springframework.integration:spring-integration-core:[4.1.0.RELEASE,)
library: library:
- org.springframework.integration:spring-integration-core:[4.1.0.RELEASE,5.+) - 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.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 - 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 source_path: instrumentation/spring/spring-jms/spring-jms-2.0
scope: scope:
name: io.opentelemetry.spring-jms-2.0 name: io.opentelemetry.spring-jms-2.0
target_versions: target_versions:
javaagent: javaagent:
- org.springframework:spring-jms:[2.0,6) - 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 - 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 source_path: instrumentation/spring/spring-jms/spring-jms-6.0
minimum_java_version: 17 minimum_java_version: 17
scope: scope:
@ -3639,14 +3844,104 @@ libraries:
target_versions: target_versions:
javaagent: javaagent:
- org.springframework:spring-jms:[6.0.0,) - 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.message.id
type: STRING
- name: messaging.operation
type: STRING
- name: messaging.system
type: STRING
- name: spring-kafka-2.7 - name: spring-kafka-2.7
description: This instrumentation enables CONSUMER spans for Spring Kafka listeners.
source_path: instrumentation/spring/spring-kafka-2.7 source_path: instrumentation/spring/spring-kafka-2.7
scope: scope:
name: io.opentelemetry.spring-kafka-2.7 name: io.opentelemetry.spring-kafka-2.7
target_versions: target_versions:
javaagent: javaagent:
- org.springframework.kafka:spring-kafka:[2.7.0,) - 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: 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
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: 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
- name: spring-pulsar-1.0 - name: spring-pulsar-1.0
description: This instrumentation enables CONSUMER spans for Spring Pulsar listeners.
source_path: instrumentation/spring/spring-pulsar-1.0 source_path: instrumentation/spring/spring-pulsar-1.0
minimum_java_version: 17 minimum_java_version: 17
scope: scope:
@ -3654,28 +3949,141 @@ libraries:
target_versions: target_versions:
javaagent: javaagent:
- org.springframework.pulsar:spring-pulsar:[1.0.0,) - 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 - name: spring-rabbit-1.0
description: This instrumentation enables CONSUMER spans for Spring RabbitMQ listeners.
source_path: instrumentation/spring/spring-rabbit-1.0 source_path: instrumentation/spring/spring-rabbit-1.0
scope: scope:
name: io.opentelemetry.spring-rabbit-1.0 name: io.opentelemetry.spring-rabbit-1.0
target_versions: target_versions:
javaagent: javaagent:
- org.springframework.amqp:spring-rabbit:(,) - 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.message.body.size
type: LONG
- name: messaging.operation
type: STRING
- name: messaging.system
type: STRING
- name: spring-rmi-4.0 - 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 source_path: instrumentation/spring/spring-rmi-4.0
scope: scope:
name: io.opentelemetry.spring-rmi-4.0 name: io.opentelemetry.spring-rmi-4.0
target_versions: target_versions:
javaagent: javaagent:
- org.springframework:spring-context:[4.0.0.RELEASE,6) - 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 - name: spring-scheduling-3.1
description: This instrumentation enables tracing for Spring Scheduling tasks.
source_path: instrumentation/spring/spring-scheduling-3.1 source_path: instrumentation/spring/spring-scheduling-3.1
scope: scope:
name: io.opentelemetry.spring-scheduling-3.1 name: io.opentelemetry.spring-scheduling-3.1
target_versions: target_versions:
javaagent: javaagent:
- org.springframework:spring-context:[3.1.0.RELEASE,] - 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 - 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 source_path: instrumentation/spring/spring-security-config-6.0
minimum_java_version: 17 minimum_java_version: 17
scope: scope:
@ -3689,29 +4097,38 @@ libraries:
- org.springframework:spring-web:6.0.0 - org.springframework:spring-web:6.0.0
- jakarta.servlet:jakarta.servlet-api:6.0.0 - jakarta.servlet:jakarta.servlet-api:6.0.0
- org.springframework.security:spring-security-web: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 - 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 source_path: instrumentation/spring/spring-web/spring-web-3.1
scope: scope:
name: io.opentelemetry.spring-web-3.1 name: io.opentelemetry.spring-web-3.1
target_versions: target_versions:
javaagent: javaagent:
- org.springframework:spring-web:[3.1.0.RELEASE,6) - org.springframework:spring-web:[3.1.0.RELEASE,6)
- name: spring-web-6.0
source_path: instrumentation/spring/spring-web/spring-web-6.0
scope:
name: io.opentelemetry.spring-web-6.0
target_versions:
javaagent:
- org.springframework:spring-web:[6.0.0,)
- name: spring-webflux-5.0
source_path: instrumentation/spring/spring-webflux/spring-webflux-5.0
scope:
name: io.opentelemetry.spring-webflux-5.0
target_versions:
javaagent:
- 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,)
telemetry: telemetry:
- when: default - when: default
metrics: metrics:
@ -3728,25 +4145,266 @@ libraries:
type: STRING type: STRING
- name: server.port - name: server.port
type: LONG 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
target_versions:
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
target_versions:
javaagent:
- 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: otel.instrumentation.common.experimental.controller-telemetry.enabled
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
- span_kind: INTERNAL
attributes:
- name: code.function
type: STRING
- name: code.namespace
type: STRING
- name: spring-webflux-5.3 - 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 source_path: instrumentation/spring/spring-webflux/spring-webflux-5.3
scope: scope:
name: io.opentelemetry.spring-webflux-5.3 name: io.opentelemetry.spring-webflux-5.3
target_versions: target_versions:
library: library:
- org.springframework:spring-webflux:5.3.0 - 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 - 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 source_path: instrumentation/spring/spring-webmvc/spring-webmvc-3.1
scope: scope:
name: io.opentelemetry.spring-webmvc-3.1 name: io.opentelemetry.spring-webmvc-3.1
target_versions: target_versions:
javaagent: javaagent:
- org.springframework:spring-webmvc:[3.1.0.RELEASE,6) - 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 - 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 source_path: instrumentation/spring/spring-webmvc/spring-webmvc-5.3
scope: scope:
name: io.opentelemetry.spring-webmvc-5.3 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 - 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 source_path: instrumentation/spring/spring-webmvc/spring-webmvc-6.0
minimum_java_version: 17 minimum_java_version: 17
scope: scope:
@ -3754,6 +4412,39 @@ libraries:
target_versions: target_versions:
javaagent: javaagent:
- org.springframework:spring-webmvc:[6.0.0,) - 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 - name: spring-ws-2.0
disabled_by_default: true disabled_by_default: true
source_path: instrumentation/spring/spring-ws-2.0 source_path: instrumentation/spring/spring-ws-2.0

View File

@ -90,6 +90,31 @@ readonly INSTRUMENTATIONS=(
"apache-dubbo-2.7:javaagent:testDubbo" "apache-dubbo-2.7:javaagent:testDubbo"
"finagle-http-23.11:javaagent:test" "finagle-http-23.11:javaagent:test"
"finatra-2.9: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=( readonly COLIMA_INSTRUMENTATIONS=(
@ -221,7 +246,7 @@ run_gradle_tasks() {
./gradlew "${tasks[@]}" \ ./gradlew "${tasks[@]}" \
-PcollectMetadata=true \ -PcollectMetadata=true \
--rerun-tasks --continue --rerun-tasks --continue --no-parallel
} }
# Cleans any stray .telemetry directories left in the repo. # Cleans any stray .telemetry directories left in the repo.

View File

@ -28,7 +28,7 @@ In order to collect spans, add the `collectSpans` property (along with `collectM
```kotlin ```kotlin
tasks { tasks {
test { test {
systemProperty("collectMetadata", collectMetadata) systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true) systemProperty("collectSpans", true)
} }
} }

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.docs; package io.opentelemetry.instrumentation.docs;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
import com.fasterxml.jackson.databind.exc.ValueInstantiationException; import com.fasterxml.jackson.databind.exc.ValueInstantiationException;
import io.opentelemetry.instrumentation.docs.internal.InstrumentationMetaData; import io.opentelemetry.instrumentation.docs.internal.InstrumentationMetaData;
import io.opentelemetry.instrumentation.docs.internal.InstrumentationModule; import io.opentelemetry.instrumentation.docs.internal.InstrumentationModule;
@ -76,7 +77,7 @@ class InstrumentationAnalyzer {
} }
try { try {
return YamlHelper.metaDataParser(metadataFile); return YamlHelper.metaDataParser(metadataFile);
} catch (ValueInstantiationException e) { } catch (ValueInstantiationException | MismatchedInputException e) {
logger.severe("Error parsing metadata file for " + module.getInstrumentationName()); logger.severe("Error parsing metadata file for " + module.getInstrumentationName());
throw e; throw e;
} }

View File

@ -24,7 +24,8 @@ import java.util.Set;
public class SpanParser { public class SpanParser {
// We want to ignore test related attributes // We want to ignore test related attributes
private static final List<String> EXCLUDED_ATTRIBUTES = List.of("x-test-", "test-baggage-"); private static final List<String> 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. * Pull spans from the `.telemetry` directory, filter them by scope, and set them in the module.

View File

@ -4,7 +4,9 @@ configurations:
type: boolean type: boolean
default: false default: false
- name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - 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 type: boolean
default: false default: false
- name: otel.instrumentation.messaging.experimental.capture-headers - name: otel.instrumentation.messaging.experimental.capture-headers

View File

@ -1,6 +1,8 @@
configurations: configurations:
- name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - 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 type: boolean
default: false default: false
- name: otel.instrumentation.messaging.experimental.capture-headers - name: otel.instrumentation.messaging.experimental.capture-headers

View File

@ -1,9 +1,9 @@
configurations: configurations:
- name: otel.instrumentation.common.experimental.view-telemetry.enabled - name: otel.instrumentation.common.experimental.view-telemetry.enabled
description: Enables experimental view telemetry. description: Enables the creation of experimental view (INTERNAL) spans.
type: boolean type: boolean
default: false default: false
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled - name: otel.instrumentation.common.experimental.controller-telemetry.enabled
description: Enables experimental controller telemetry. description: Enables the creation of experimental controller (INTERNAL) spans.
type: boolean type: boolean
default: false default: false

View File

@ -15,6 +15,8 @@ configurations:
type: list type: list
default: '' default: ''
- name: otel.instrumentation.messaging.experimental.receive-telemetry.enabled - 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 type: boolean
default: false default: false

View File

@ -25,6 +25,9 @@ tasks {
withType<Test>().configureEach { withType<Test>().configureEach {
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
// TODO run tests both with and without genai message capture // TODO run tests both with and without genai message capture
systemProperty("otel.instrumentation.genai.capture-message-content", "true") systemProperty("otel.instrumentation.genai.capture-message-content", "true")
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
} }
} }

View File

@ -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.

View File

@ -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-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-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.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, 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. |

View File

@ -48,6 +48,10 @@ tasks {
excludeTestsMatching("*ItemLevelSpanTest") excludeTestsMatching("*ItemLevelSpanTest")
excludeTestsMatching("*CustomSpanEventTest") excludeTestsMatching("*CustomSpanEventTest")
} }
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
systemProperty("metaDataConfig", "otel.instrumentation.spring-batch.experimental-span-attributes=true")
} }
check { check {

View File

@ -1 +1,15 @@
disabled_by_default: true disabled_by_default: true
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
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

View File

@ -1 +1,4 @@
disabled_by_default: true 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.

View File

@ -3,8 +3,7 @@
Auto-configures OpenTelemetry instrumentation for [spring-web](../spring-web/spring-web-3.1/library) Auto-configures OpenTelemetry instrumentation for [spring-web](../spring-web/spring-web-3.1/library)
, [spring-webmvc](../spring-webmvc/spring-webmvc-5.3/library), , [spring-webmvc](../spring-webmvc/spring-webmvc-5.3/library),
and [spring-webflux](../spring-webflux/spring-webflux-5.3/library). Leverages Spring Aspect Oriented and [spring-webflux](../spring-webflux/spring-webflux-5.3/library). Leverages Spring Aspect Oriented
Programming, Programming, dependency injection, and bean post-processing to trace spring applications. To include
dependency injection, and bean post-processing to trace spring applications. To include all features all features listed below use the [opentelemetry-spring-boot-starter](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/).
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/). 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/).

View File

@ -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. This instrumentation is mostly used as part of the Spring Boot starter.

View File

@ -0,0 +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

View File

@ -0,0 +1,4 @@
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.

View File

@ -0,0 +1,11 @@
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.

View File

@ -0,0 +1,11 @@
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.

View File

@ -26,3 +26,10 @@ if (findProperty("testLatestDeps") as Boolean) {
minJavaVersionSupported.set(JavaVersion.VERSION_17) minJavaVersionSupported.set(JavaVersion.VERSION_17)
} }
} }
tasks {
test {
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
}
}

View File

@ -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 any new telemetry itself.

View File

@ -51,10 +51,14 @@ tasks {
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
} }
val testStableSemconv by registering(Test::class) { val testStableSemconv by registering(Test::class) {
jvmArgs("-Dotel.semconv-stability.opt-in=database") jvmArgs("-Dotel.semconv-stability.opt-in=database")
systemProperty("metaDataConfig", "otel.semconv-stability.opt-in=database")
} }
check { check {

View File

@ -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.

View File

@ -48,6 +48,7 @@ tasks {
include("**/SpringIntegrationAndRabbitTest.*") include("**/SpringIntegrationAndRabbitTest.*")
jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=true") jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=true")
jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=true") jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=true")
systemProperty("metaDataConfig", "otel.instrumentation.spring-rabbit.enabled=true")
} }
val testWithProducerInstrumentation by registering(Test::class) { val testWithProducerInstrumentation by registering(Test::class) {
@ -58,6 +59,7 @@ tasks {
jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=false") jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=false")
jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=false") jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=false")
jvmArgs("-Dotel.instrumentation.spring-integration.producer.enabled=true") jvmArgs("-Dotel.instrumentation.spring-integration.producer.enabled=true")
systemProperty("metaDataConfig", "otel.instrumentation.spring-integration.producer.enabled=true")
} }
test { test {
@ -77,6 +79,9 @@ tasks {
withType<Test>().configureEach { withType<Test>().configureEach {
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
} }
} }

View File

@ -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: ''

View File

@ -61,6 +61,8 @@ configurations {
tasks { tasks {
withType<Test>().configureEach { withType<Test>().configureEach {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
} }
// this does not apply to testReceiveSpansDisabled // this does not apply to testReceiveSpansDisabled
test { test {

View File

@ -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: ''

View File

@ -37,6 +37,8 @@ otelJava {
tasks { tasks {
withType<Test>().configureEach { withType<Test>().configureEach {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
} }
val testReceiveSpansDisabled by registering(Test::class) { val testReceiveSpansDisabled by registering(Test::class) {

View File

@ -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: ''

View File

@ -32,6 +32,7 @@ dependencies {
} }
val latestDepTest = findProperty("testLatestDeps") as Boolean val latestDepTest = findProperty("testLatestDeps") as Boolean
val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false"
testing { testing {
suites { suites {
@ -54,6 +55,9 @@ testing {
jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=false") jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=false")
jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=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) systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=true") jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=true")
jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=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 { check {

View File

@ -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

View File

@ -25,6 +25,7 @@ dependencies {
} }
val latestDepTest = findProperty("testLatestDeps") as Boolean val latestDepTest = findProperty("testLatestDeps") as Boolean
val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false"
testing { testing {
suites { suites {
@ -61,8 +62,11 @@ tasks {
test { test {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) 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") jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true")
systemProperty("collectMetadata", collectMetadata)
systemProperty("collectSpans", true)
} }
check { check {

View File

@ -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

View File

@ -51,6 +51,8 @@ public abstract class AbstractSpringPulsarTest {
@RegisterExtension @RegisterExtension
protected static final InstrumentationExtension testing = AgentInstrumentationExtension.create(); protected static final InstrumentationExtension testing = AgentInstrumentationExtension.create();
static final String EXPERIMENTAL_FLAG =
"otel.instrumentation.pulsar.experimental-span-attributes";
static final DockerImageName DEFAULT_IMAGE_NAME = static final DockerImageName DEFAULT_IMAGE_NAME =
DockerImageName.parse("apachepulsar/pulsar:4.0.2"); DockerImageName.parse("apachepulsar/pulsar:4.0.2");
static PulsarContainer pulsarContainer; static PulsarContainer pulsarContainer;
@ -121,7 +123,14 @@ public abstract class AbstractSpringPulsarTest {
satisfies(MESSAGING_MESSAGE_ID, AbstractStringAssert::isNotEmpty), satisfies(MESSAGING_MESSAGE_ID, AbstractStringAssert::isNotEmpty),
equalTo(SERVER_ADDRESS, brokerHost), equalTo(SERVER_ADDRESS, brokerHost),
equalTo(SERVER_PORT, brokerPort), 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<AttributeAssertion> processAttributes() { protected List<AttributeAssertion> processAttributes() {

View File

@ -26,6 +26,8 @@ dependencies {
tasks { tasks {
test { test {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
} }
} }

View File

@ -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: ''

View File

@ -35,6 +35,8 @@ otelJava {
tasks.withType<Test>().configureEach { tasks.withType<Test>().configureEach {
jvmArgs("-Djava.rmi.server.hostname=127.0.0.1") jvmArgs("-Djava.rmi.server.hostname=127.0.0.1")
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
} }
configurations.testRuntimeClasspath { configurations.testRuntimeClasspath {

View File

@ -0,0 +1 @@
description: This instrumentation enables CLIENT and SERVER spans for Spring RMI applications.

View File

@ -20,13 +20,20 @@ dependencies {
testLibrary("org.springframework:spring-context:3.2.3.RELEASE") testLibrary("org.springframework:spring-context:3.2.3.RELEASE")
} }
tasks.withType<Test>().configureEach { tasks {
// TODO run tests both with and without experimental span attributes withType<Test>().configureEach {
jvmArgs("-Dotel.instrumentation.spring-scheduling.experimental-span-attributes=true")
// required on jdk17 // required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") 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 val latestDepTest = findProperty("testLatestDeps") as Boolean

View File

@ -39,6 +39,9 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
class SpringSchedulingTest { class SpringSchedulingTest {
private static final String EXPERIMENTAL_FLAG =
"otel.instrumentation.spring-scheduling.experimental-span-attributes";
@RegisterExtension @RegisterExtension
private static final InstrumentationExtension testing = AgentInstrumentationExtension.create(); private static final InstrumentationExtension testing = AgentInstrumentationExtension.create();
@ -54,6 +57,9 @@ class SpringSchedulingTest {
} }
} }
private static final String JOB_SYSTEM =
Boolean.getBoolean(EXPERIMENTAL_FLAG) ? "spring_scheduling" : null;
@Test @Test
void scheduleCronExpressionTest() throws InterruptedException { void scheduleCronExpressionTest() throws InterruptedException {
try (AnnotationConfigApplicationContext context = try (AnnotationConfigApplicationContext context =
@ -62,7 +68,7 @@ class SpringSchedulingTest {
task.blockUntilExecute(); task.blockUntilExecute();
List<AttributeAssertion> assertions = codeFunctionAssertions(TriggerTask.class, "run"); List<AttributeAssertion> 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(); assertThat(task).isNotNull();
testing.waitAndAssertTraces( testing.waitAndAssertTraces(
@ -83,7 +89,7 @@ class SpringSchedulingTest {
task.blockUntilExecute(); task.blockUntilExecute();
List<AttributeAssertion> assertions = codeFunctionAssertions(IntervalTask.class, "run"); List<AttributeAssertion> 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(); assertThat(task).isNotNull();
testing.waitAndAssertTraces( testing.waitAndAssertTraces(
@ -105,7 +111,7 @@ class SpringSchedulingTest {
List<AttributeAssertion> assertions = List<AttributeAssertion> assertions =
codeFunctionPrefixAssertions(LambdaTaskConfigurer.class.getName() + "$$Lambda", "run"); 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(); assertThat(configurer).isNotNull();
testing.waitAndAssertTraces( testing.waitAndAssertTraces(
@ -127,7 +133,7 @@ class SpringSchedulingTest {
List<AttributeAssertion> assertions = List<AttributeAssertion> assertions =
codeFunctionAssertions(EnhancedClassTaskConfig.class, "run"); 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(); assertThat(latch).isNotNull();
testing.waitAndAssertTraces( testing.waitAndAssertTraces(
@ -148,7 +154,7 @@ class SpringSchedulingTest {
task.blockUntilExecute(); task.blockUntilExecute();
List<AttributeAssertion> assertions = codeFunctionAssertions(TaskWithError.class, "run"); List<AttributeAssertion> 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(); assertThat(task).isNotNull();
testing.waitAndAssertTraces( testing.waitAndAssertTraces(

View File

@ -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

View File

@ -18,3 +18,9 @@ dependencies {
otelJava { otelJava {
minJavaVersionSupported.set(JavaVersion.VERSION_17) 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)
}

View File

@ -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_"

View File

@ -19,3 +19,10 @@ if (latestDepTest) {
minJavaVersionSupported.set(JavaVersion.VERSION_17) minJavaVersionSupported.set(JavaVersion.VERSION_17)
} }
} }
tasks {
test {
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
}
}

View File

@ -0,0 +1,4 @@
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.

View File

@ -0,0 +1 @@
description: This instrumentation enriches HTTP server spans and metrics with route information.

View File

@ -61,18 +61,20 @@ dependencies {
testLibrary("org.springframework.boot:spring-boot-starter-reactor-netty:2.0.0.RELEASE") testLibrary("org.springframework.boot:spring-boot-starter-reactor-netty:2.0.0.RELEASE")
} }
val latestDepTest = findProperty("testLatestDeps") as Boolean
tasks.withType<Test>().configureEach { tasks.withType<Test>().configureEach {
// required on jdk17 // required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") 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("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
} }
val latestDepTest = findProperty("testLatestDeps") as Boolean
if (latestDepTest) { if (latestDepTest) {
// spring 6 requires java 17 // spring 6 requires java 17
otelJava { otelJava {

View File

@ -0,0 +1,8 @@
description: >
This instrumentation enables HTTP client spans and metrics for Spring WebFlux 5.0. It also
optionally enables experimental controller (INTERNAL) spans.
configurations:
- name: otel.instrumentation.common.experimental.controller-telemetry.enabled
description: Enables the creation of experimental controller (INTERNAL) spans.
type: boolean
default: false

View File

@ -33,3 +33,10 @@ if (!latestDepTest) {
} }
} }
} }
tasks {
test {
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
}
}

View File

@ -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.

View File

@ -43,18 +43,31 @@ dependencies {
latestDepTestLibrary("org.springframework.boot:spring-boot-starter-security:2.+") // see spring-webmvc-6.0 module latestDepTestLibrary("org.springframework.boot:spring-boot-starter-security:2.+") // see spring-webmvc-6.0 module
} }
tasks.withType<Test>().configureEach { tasks {
withType<Test>().configureEach {
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) 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 // required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") 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.controller-telemetry.enabled=true")
jvmArgs("-Dotel.instrumentation.common.experimental.view-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 { configurations.testRuntimeClasspath {
resolutionStrategy { resolutionStrategy {
// requires old logback (and therefore also old slf4j) // requires old logback (and therefore also old slf4j)

View File

@ -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

View File

@ -22,3 +22,10 @@ configurations.testRuntimeClasspath {
force("org.slf4j:slf4j-api:1.7.36") force("org.slf4j:slf4j-api:1.7.36")
} }
} }
tasks {
test {
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
}
}

View File

@ -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.

View File

@ -44,14 +44,26 @@ otelJava {
minJavaVersionSupported.set(JavaVersion.VERSION_17) minJavaVersionSupported.set(JavaVersion.VERSION_17)
} }
tasks.withType<Test>().configureEach { tasks {
// TODO run tests both with and without experimental span attributes withType<Test>().configureEach {
jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true")
// required on jdk17 // required on jdk17
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
jvmArgs("-Dotel.instrumentation.common.experimental.view-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) 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)
}
}

View File

@ -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

View File

@ -51,6 +51,9 @@ import org.springframework.web.servlet.view.RedirectView;
public abstract class AbstractSpringBootBasedTest public abstract class AbstractSpringBootBasedTest
extends AbstractHttpServerTest<ConfigurableApplicationContext> { extends AbstractHttpServerTest<ConfigurableApplicationContext> {
private static final String EXPERIMENTAL_SPAN_CONFIG =
"otel.instrumentation.spring-webmvc.experimental-span-attributes";
protected abstract ConfigurableApplicationContext context(); protected abstract ConfigurableApplicationContext context();
protected abstract Class<?> securityConfigClass(); protected abstract Class<?> securityConfigClass();
@ -177,7 +180,8 @@ public abstract class AbstractSpringBootBasedTest
.hasKind(SpanKind.INTERNAL) .hasKind(SpanKind.INTERNAL)
.hasAttributesSatisfyingExactly( .hasAttributesSatisfyingExactly(
equalTo( equalTo(
AttributeKey.stringKey("spring-webmvc.view.type"), RedirectView.class.getName())); AttributeKey.stringKey("spring-webmvc.view.type"),
experimental(RedirectView.class.getName())));
return span; return span;
} }
@ -208,6 +212,13 @@ public abstract class AbstractSpringBootBasedTest
return span; return span;
} }
private static String experimental(String value) {
if (!Boolean.getBoolean(EXPERIMENTAL_SPAN_CONFIG)) {
return null;
}
return value;
}
private static String getHandlerSpanName(ServerEndpoint endpoint) { private static String getHandlerSpanName(ServerEndpoint endpoint) {
if (QUERY_PARAM.equals(endpoint)) { if (QUERY_PARAM.equals(endpoint)) {
return "TestController.queryParam"; return "TestController.queryParam";