Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
703 changes: 697 additions & 6 deletions docs/instrumentation-list.yaml

Large diffs are not rendered by default.

27 changes: 26 additions & 1 deletion instrumentation-docs/collect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion instrumentation-docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
public class SpanParser {

// 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.
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/aws-sdk/aws-sdk-1.11/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably want to have a glossary of all config properties like we have for all semantic attributes at some point - to avoid this repetition

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, weaver uses references to attributes and other things defined in registries, so I imagine we'll eventually do something similar

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
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/aws-sdk/aws-sdk-2.2/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ tasks {
withType<Test>().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)
}
}
9 changes: 9 additions & 0 deletions instrumentation/openai/openai-java-1.1/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions instrumentation/spring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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. |
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ tasks {
excludeTestsMatching("*ItemLevelSpanTest")
excludeTestsMatching("*CustomSpanEventTest")
}

systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First I need to go through and review all of the module gradle files so that I can tag the resulting telemetry accordingly, based on the configuration flags. Once we have annotated all the test suites, we can remove the individual collectMetadata and collectSpans from the individual files and add them globally like you suggest

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could also pass flags like here to indicate which modules support this:

systemProperty("collectSpans", true)
systemProperty("metaDataConfig", "otel.instrumentation.spring-batch.experimental-span-attributes=true")
}

check {
Expand Down
14 changes: 14 additions & 0 deletions instrumentation/spring/spring-batch-3.0/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
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
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 2 additions & 3 deletions instrumentation/spring/spring-boot-autoconfigure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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](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/).
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 14 additions & 0 deletions instrumentation/spring/spring-boot-resources/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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

4 changes: 4 additions & 0 deletions instrumentation/spring/spring-cloud-aws-3.0/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
5 changes: 5 additions & 0 deletions instrumentation/spring/spring-core-2.0/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ tasks {
include("**/SpringIntegrationAndRabbitTest.*")
jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=true")
jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=true")
systemProperty("metaDataConfig", "otel.instrumentation.spring-rabbit.enabled=true")
}

val testWithProducerInstrumentation by registering(Test::class) {
Expand All @@ -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 {
Expand All @@ -77,6 +79,9 @@ tasks {
withType<Test>().configureEach {
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)

systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
}
}

Expand Down
18 changes: 18 additions & 0 deletions instrumentation/spring/spring-integration-4.1/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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: ''

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ configurations {
tasks {
withType<Test>().configureEach {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
}
// this does not apply to testReceiveSpansDisabled
test {
Expand Down
12 changes: 12 additions & 0 deletions instrumentation/spring/spring-jms/spring-jms-2.0/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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: ''
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ otelJava {
tasks {
withType<Test>().configureEach {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false")
systemProperty("collectSpans", true)
}

val testReceiveSpansDisabled by registering(Test::class) {
Expand Down
12 changes: 12 additions & 0 deletions instrumentation/spring/spring-jms/spring-jms-6.0/metadata.yaml
Original file line number Diff line number Diff line change
@@ -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: ''
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies {
}

val latestDepTest = findProperty("testLatestDeps") as Boolean
val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false"

testing {
suites {
Expand All @@ -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)
}
}
}
Expand All @@ -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 {
Expand Down
Loading
Loading