diff --git a/README.adoc b/README.adoc
index e457c737d..aa78f0555 100644
--- a/README.adoc
+++ b/README.adoc
@@ -49,23 +49,6 @@ Example of Sleuth with Brave tracer:
org.springframework.cloud
spring-cloud-starter-sleuth
-
-
----
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index 17a834e9d..15361f809 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -68,10 +68,6 @@
${project.groupId}
spring-cloud-starter-sleuth
-
- ${project.groupId}
- spring-cloud-sleuth-otel
-
org.springframework.boot
spring-boot-starter-web
diff --git a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/SampleTests.java b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/SampleTests.java
index c71fa92f7..3cadc3077 100644
--- a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/SampleTests.java
+++ b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/SampleTests.java
@@ -99,7 +99,6 @@ public class SampleTests {
protected String[] runArgs() {
List strings = new ArrayList<>();
strings.addAll(Arrays.asList("--spring.jmx.enabled=false",
- "--spring.autoconfigure.exclude=org.springframework.cloud.sleuth.otel.autoconfig.TraceOtelAutoConfiguration",
"--spring.application.name=defaultTraceContextForStream" + instrumentation.name()));
strings.addAll(instrumentation.entires.stream().map(s -> "--" + s).collect(Collectors.toList()));
return strings.toArray(new String[0]);
diff --git a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/TracerImplementation.java b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/TracerImplementation.java
index 500277a11..75fa5373b 100644
--- a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/TracerImplementation.java
+++ b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/TracerImplementation.java
@@ -16,24 +16,9 @@
package org.springframework.cloud.sleuth.benchmarks.jmh;
-import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
-
public enum TracerImplementation {
- otel(BraveAutoConfiguration.class.getCanonicalName()), brave(OtelAutoConfiguration.class.getCanonicalName());
-
- private String key = "spring.autoconfigure.exclude";
-
- private String value;
-
- TracerImplementation(String value) {
- this.value = value;
- }
-
- public String property() {
- return "--" + this.key + "=" + this.value;
- }
+ brave;
@Override
public String toString() {
diff --git a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/bridge/BridgeTests.java b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/bridge/BridgeTests.java
index 3f193f3a5..f14424c77 100644
--- a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/bridge/BridgeTests.java
+++ b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/bridge/BridgeTests.java
@@ -38,7 +38,6 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.cloud.sleuth.Span;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.benchmarks.jmh.TracerImplementation;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;
@@ -106,7 +105,7 @@ public class BridgeTests {
public void setup() {
SpringApplication application = new SpringApplication(TestConfiguration.class);
application.setWebApplicationType(WebApplicationType.NONE);
- this.withSleuth = application.run("--spring.jmx.enabled=false", this.tracerImplementation.property(),
+ this.withSleuth = application.run("--spring.jmx.enabled=false",
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
this.tracer = this.withSleuth.getBean(Tracer.class);
this.parent = this.tracer.nextSpan().name("name").start();
@@ -119,7 +118,7 @@ public class BridgeTests {
}
@Configuration(proxyBeanMethods = false)
- @ImportAutoConfiguration({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+ @ImportAutoConfiguration(BraveAutoConfiguration.class)
static class TestConfiguration {
}
diff --git a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AnnotationBenchmarksTests.java b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AnnotationBenchmarksTests.java
index 7de0ede9b..16b014d0a 100644
--- a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AnnotationBenchmarksTests.java
+++ b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AnnotationBenchmarksTests.java
@@ -72,7 +72,7 @@ public class AnnotationBenchmarksTests {
@Setup
public void setup() {
this.withSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run("--spring.jmx.enabled=false",
- this.tracerImplementation.property(),
+
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
this.sleuth = this.withSleuth.getBean(SleuthBenchmarkingSpringApp.class);
}
diff --git a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AsyncBenchmarksTests.java b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AsyncBenchmarksTests.java
index 3ab976788..53dd03de1 100644
--- a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AsyncBenchmarksTests.java
+++ b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AsyncBenchmarksTests.java
@@ -76,7 +76,7 @@ public class AsyncBenchmarksTests {
@Setup
public void setup() {
this.withSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run("--spring.jmx.enabled=false",
- this.tracerImplementation.property(),
+
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
this.withoutSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run(
"--spring.jmx.enabled=false", "--spring.application.name=withoutSleuth",
diff --git a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/HttpFilterBenchmarksTests.java b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/HttpFilterBenchmarksTests.java
index 89eb3c9f9..229ca844f 100644
--- a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/HttpFilterBenchmarksTests.java
+++ b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/HttpFilterBenchmarksTests.java
@@ -139,7 +139,7 @@ public class HttpFilterBenchmarksTests {
@Setup
public void setup() {
this.withSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run("--spring.jmx.enabled=false",
- this.tracerImplementation.property(),
+
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
this.tracingFilter = this.withSleuth.getBean(TracingFilter.class);
this.mockMvcForTracedController = MockMvcBuilders
diff --git a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/RestTemplateBenchmarkTests.java b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/RestTemplateBenchmarkTests.java
index c3378d389..33ad3d4d9 100644
--- a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/RestTemplateBenchmarkTests.java
+++ b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/RestTemplateBenchmarkTests.java
@@ -88,7 +88,7 @@ public class RestTemplateBenchmarkTests {
@Setup
public void setup() {
this.withSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run("--spring.jmx.enabled=false",
- this.tracerImplementation.property(),
+
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
this.mockMvc = MockMvcBuilders.standaloneSetup(this.withSleuth.getBean(SleuthBenchmarkingSpringApp.class))
.build();
diff --git a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/stream/MicroBenchmarkStreamTests.java b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/stream/MicroBenchmarkStreamTests.java
index d80d303fa..6c332d407 100644
--- a/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/stream/MicroBenchmarkStreamTests.java
+++ b/benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/stream/MicroBenchmarkStreamTests.java
@@ -107,7 +107,7 @@ public class MicroBenchmarkStreamTests {
protected String[] runArgs() {
List strings = new ArrayList<>();
- strings.addAll(Arrays.asList("--spring.jmx.enabled=false", this.tracerImplementation.property(),
+ strings.addAll(Arrays.asList("--spring.jmx.enabled=false",
"--spring.application.name=defaultTraceContextForStream" + instrumentation.name() + "_"
+ tracerImplementation.name()));
strings.addAll(instrumentation.entires.stream().map(s -> "--" + s).collect(Collectors.toList()));
diff --git a/docs/pom.xml b/docs/pom.xml
index 9b9c12e89..266a194e5 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -38,10 +38,6 @@
${project.groupId}
spring-cloud-starter-sleuth
-
- ${project.groupId}
- spring-cloud-sleuth-otel
-
${project.groupId}
spring-cloud-sleuth-zipkin
diff --git a/docs/src/main/asciidoc/README.adoc b/docs/src/main/asciidoc/README.adoc
index 05c7ccc36..95b07fd51 100644
--- a/docs/src/main/asciidoc/README.adoc
+++ b/docs/src/main/asciidoc/README.adoc
@@ -42,23 +42,6 @@ Example of Sleuth with Brave tracer:
org.springframework.cloud
spring-cloud-starter-sleuth
-
-
----
diff --git a/docs/src/main/asciidoc/_attributes.adoc b/docs/src/main/asciidoc/_attributes.adoc
index e7046300c..60d80c43c 100644
--- a/docs/src/main/asciidoc/_attributes.adoc
+++ b/docs/src/main/asciidoc/_attributes.adoc
@@ -20,8 +20,6 @@
:autoconfig_path: {project-root}/spring-cloud-sleuth-autoconfigure
:api_path: {project-root}/spring-cloud-sleuth-api
:brave_path: {project-root}/spring-cloud-sleuth-brave
-:otel_path: {project-root}/spring-cloud-sleuth-otel
:tests_path: {core_path}/tests
:common_tests_path: {tests_path}/common
:brave_tests_path: {tests_path}/brave
-:otel_tests_path: {tests_path}/otel
diff --git a/docs/src/main/asciidoc/_configprops.adoc b/docs/src/main/asciidoc/_configprops.adoc
index 0cf45d1b8..a0e3a907d 100644
--- a/docs/src/main/asciidoc/_configprops.adoc
+++ b/docs/src/main/asciidoc/_configprops.adoc
@@ -32,19 +32,6 @@
|spring.sleuth.messaging.rabbit.enabled | `true` | Enable tracing of RabbitMQ.
|spring.sleuth.mongodb.enabled | `true` | Enable tracing for MongoDb.
|spring.sleuth.opentracing.enabled | `true` | Enables OpenTracing support.
-|spring.sleuth.otel.config.instrumentation-name | `org.springframework.cloud.spring-cloud-sleuth` | Instrumentation name to be used to find a Tracer.
-|spring.sleuth.otel.config.instrumentation-version | | Instrumentation version to be used to find a Tracer.
-|spring.sleuth.otel.config.max-attr-length | `0` | Returns the global default max length of string attribute value in characters.
-|spring.sleuth.otel.config.max-attrs | `0` | Returns the global default max number of attributes per {@link Span}.
-|spring.sleuth.otel.config.max-event-attrs | `0` | Returns the global default max number of attributes per event.
-|spring.sleuth.otel.config.max-events | `0` | Returns the global default max number of events per {@link Span}.
-|spring.sleuth.otel.config.max-link-attrs | `0` | Returns the global default max number of attributes per link.
-|spring.sleuth.otel.config.max-links | `0` | Returns the global default max number of link entries per {@link Span}.
-|spring.sleuth.otel.exporter.sleuth-span-filter.enabled | `true` | Enables Sleuth span filter.
-|spring.sleuth.otel.log.exporter.enabled | `false` | Enable log exporter for OTel.
-|spring.sleuth.otel.log.slf4j.enabled | `false` | Enable slf4j support for OTel.
-|spring.sleuth.otel.propagation.composite-text-map-propagator.enabled | `true` | Enable a composite text map propagator that can combine multiple propagation types into a single text map propagator.
-|spring.sleuth.otel.propagation.sleuth-baggage.enabled | `true` | Enable propagating baggage in a Sleuth compatible way (baggage key & value pair means e.g. a key & value HTTP pair).
|spring.sleuth.propagation.type | | Tracing context propagation types.
|spring.sleuth.quartz.enabled | `true` | Enable tracing for Quartz.
|spring.sleuth.reactor.decorate-on-each | `true` | When true decorates on each operator, will be less performing, but logging will always contain the tracing entries in each operator. When false decorates on last operator, will be more performing, but logging might not always contain the tracing entries. @deprecated use explicit value via {@link SleuthReactorProperties#instrumentationType}
diff --git a/docs/src/main/asciidoc/documentation-overview.adoc b/docs/src/main/asciidoc/documentation-overview.adoc
index c184f6f8e..9bae80a47 100644
--- a/docs/src/main/asciidoc/documentation-overview.adoc
+++ b/docs/src/main/asciidoc/documentation-overview.adoc
@@ -65,8 +65,7 @@ Need more details about {project-full-name}'s core features?
<>
* *Tracer Features:*
-<> |
-<>
+<>
* *Reporting Features:*
<> |
diff --git a/docs/src/main/asciidoc/getting-started.adoc b/docs/src/main/asciidoc/getting-started.adoc
index de3f57719..6fcaef2ad 100644
--- a/docs/src/main/asciidoc/getting-started.adoc
+++ b/docs/src/main/asciidoc/getting-started.adoc
@@ -15,11 +15,10 @@ Spring Cloud Sleuth provides API for distributed tracing solution for https://cl
It integrates out of the box with two tracer implementations:
* https://github.com/openzipkin/brave[OpenZipkin Brave]
-* https://opentelemetry.io[OpenTelemetry SDK]
Spring Cloud Sleuth is able to trace your requests and messages so that you can correlate that communication to corresponding log entries.
You can also export the tracing information to an external system to visualize latency.
-Spring Cloud Sleuth supports https://zipkin.io[OpenZipkin] compatible systems directly and various other ones via the OpenTelemetry integration.
+Spring Cloud Sleuth supports https://zipkin.io[OpenZipkin] compatible systems directly.
[[getting-started-terminology]]
=== Terminology
@@ -193,36 +192,6 @@ To add the necessary dependencies, edit your `pom.xml` and add the `spring-boot-
----
-To use Sleuth with OpenTelemetry do the following.
-
-[source,xml,indent=0,subs="verbatim,quotes,attributes"]
-----
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
-----
-
[[getting-started-first-application-code]]
=== Writing the Code
diff --git a/docs/src/main/asciidoc/howto.adoc b/docs/src/main/asciidoc/howto.adoc
index efc2abd04..97ecdff11 100644
--- a/docs/src/main/asciidoc/howto.adoc
+++ b/docs/src/main/asciidoc/howto.adoc
@@ -55,60 +55,6 @@ dependencies {
----
====
-[[how-to-set-up-sleuth-with-otel]]
-== How to Set Up Sleuth with OpenTelemetry?
-
-Add the Sleuth starter, exlcude Brave and add OpenTelemetry dependency to the classpath.
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${release.train-version}
- pom
- import
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
- }
-}
-
-dependencies {
- implementation("org.springframework.cloud:spring-cloud-starter-sleuth") {
- exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave'
- }
-}
-----
-====
-
[[how-to-set-up-sleuth-with-brave-zipkin-http]]
== How to Set Up Sleuth with Brave & Zipkin via HTTP?
@@ -156,65 +102,6 @@ dependencies {
----
====
-[[how-to-set-up-sleuth-with-otel-zipkin-http]]
-== How to Set Up Sleuth with OpenTelemetry & Zipkin via HTTP?
-
-Add the Sleuth starter, exclude Brave, add OTel and Zipkin to the classpath.
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${release.train-version}
- pom
- import
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.cloud
- spring-cloud-sleuth-zipkin
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
- }
-}
-
-dependencies {
- implementation("org.springframework.cloud:spring-cloud-starter-sleuth") {
- exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave'
- }
- implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
-}
-----
-====
-
[[how-to-set-up-sleuth-with-brave-zipkin-messaging]]
== How to Set Up Sleuth with Brave & Zipkin via Messaging?
@@ -382,197 +269,6 @@ Also, you need to set the property `spring.zipkin.sender.type` property accordin
spring.zipkin.sender.type: activemq
----
-[[how-to-set-up-sleuth-with-otel-zipkin-messaging]]
-== How to Set Up Sleuth with OpenTelemetry & Zipkin via Messaging?
-
-If you want to use RabbitMQ, Kafka or ActiveMQ instead of HTTP, add the `spring-rabbit`, `spring-kafka` or `org.apache.activemq:activemq-client` dependency.
-The default destination name is `Zipkin`.
-
-If using Kafka, you must add the Kafka dependency.
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${release.train-version}
- pom
- import
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.cloud
- spring-cloud-sleuth-zipkin
-
-
- org.springframework.kafka
- spring-kafka
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
- }
-}
-
-dependencies {
- implementation("org.springframework.cloud:spring-cloud-starter-sleuth") {
- exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave'
- }
- implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
- implementation "org.springframework.kafka:spring-kafka"
-}
-----
-====
-
-Also, you need to set the property `spring.zipkin.sender.type` property accordingly:
-
-[source,yaml]
-----
-spring.zipkin.sender.type: kafka
-----
-
-If you want Sleuth over RabbitMQ, add the `spring-cloud-sleuth-otel` (exclude `spring-cloud-sleuth-brave`), `spring-cloud-sleuth-zipkin` and `spring-rabbit` dependencies.
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${release.train-version}
- pom
- import
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-zipkin
-
-
- org.springframework.amqp
- spring-rabbit
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
- }
-}
-
-dependencies {
- implementation "org.springframework.cloud:spring-cloud-starter-sleuth"
- implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
- implementation "org.springframework.amqp:spring-rabbit"
-}
-----
-====
-
-If you want Sleuth over RabbitMQ, add the `spring-cloud-sleuth-otel` (exclude `spring-cloud-sleuth-brave`), `spring-cloud-sleuth-zipkin` and `activemq-client` dependencies.
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${release.train-version}
- pom
- import
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.cloud
- spring-cloud-sleuth-zipkin
-
-
- org.apache.activemq
- activemq-client
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
- }
-}
-
-dependencies {
- implementation("org.springframework.cloud:spring-cloud-starter-sleuth") {
- exclude group: 'org.springframework.cloud', module: 'spring-cloud-sleuth-brave'
- }
- implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
- implementation "org.apache.activemq:activemq-client"
-}
-----
-====
-
-Also, you need to set the property `spring.zipkin.sender.type` property accordingly:
-
-[source,yaml]
-----
-spring.zipkin.sender.type: activemq
-----
-
[[how-to-see-spans-in-an-external-system]]
== How to See Spans in an External System?
@@ -601,42 +297,6 @@ If the boolean value in the section `[backend,0b6aaf642574edd3,0b6aaf642574edd3,
Up till Sleuth 3.0.0 the dependency `spring-cloud-starter-zipkin` included the `spring-cloud-starter-sleuth` dependency and the `spring-cloud-sleuth-zipkin` dependency.
With 3.0.0 `spring-cloud-starter-zipkin` was removed, so you need to change it to `spring-cloud-sleuth-zipkin`.
-If you're working with OpenTelemetry you need to provide the dependency with your exporter.
-For example if you want to use the OpenTelemetry Zipkin Exporter just add a dependency.
-
-====
-[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
-.Maven
-----
-
- io.opentelemetry
- opentelemetry-exporter-zipkin
-
-----
-
-[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
-.Gradle
-----
-dependencies {
- implementation "io.opentelemetry:opentelemetry-exporter-zipkin"
-}
-----
-====
-
-Then add the `SpanExporter` bean.
-
-====
-[source,java,indent=0]
-----
-@Bean SpanExporter zipkinExporter() {
- return ZipkinSpanExporter.builder()
- .setEndpoint("http://localhost/api/v2/spans")
- .setServiceName("my-service")
- .build();
-}
-----
-====
-
[[connection-misconfiguration]]
=== Connection Misconfiguration
@@ -781,30 +441,21 @@ To use the provided defaults you can set the `spring.sleuth.propagation.type` pr
The value can be a list in which case you will propagate more tracing headers.
For Brave we support `AWS`, `B3`, `W3C` propagation types.
-For OpenTelemetry we support `AWS`, `B3`, `JAEGER`, `W3C`, `OT_TRACER` and `W3C` propagation types.
-If you want to provide a custom propagation mechanism set the `spring.sleuth.propagation.type` property to `CUSTOM` and implement your own bean (`Propagation.Factory` for Brave and `TextMapPropagator` for OpenTelemetry).
+If you want to provide a custom propagation mechanism set the `spring.sleuth.propagation.type` property to `CUSTOM` and implement your own bean (`Propagation.Factory` for Brave).
Below you can find the examples:
====
-[source,java,indent=0,subs="verbatim,attributes",role="primary"]
-.Brave
+[source,java,indent=0,subs="verbatim,attributes"]
----
@Component
include::{autoconfig_path}/src/test/java/org/springframework/cloud/sleuth/autoconfig/brave/BravePropagationTests.java[tags=custom_propagator,indent=0]
----
-
-[source,java,indent=0,subs="verbatim,attributes",role="secondary"]
-.OpenTelemetry
-----
-@Component
-include::{autoconfig_path}/src/test/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfigurationTests.java[tags=custom_propagator,indent=0]
-----
====
[[how-to-implement-own-tracer]]
== How to Implement My Own Tracer?
Spring Cloud Sleuth API contains all necessary interfaces to be implemented by a tracer.
-The project comes with OpenZipkin Brave and OpenTelemetry implementations.
-You can check how both tracers are bridged to the Sleuth's API by looking at the `org.springframework.cloud.sleuth.brave.bridge` and `org.springframework.cloud.sleuth.otel.bridge` modules respectively.
\ No newline at end of file
+The project comes with OpenZipkin Brave implementation.
+You can check how both tracers are bridged to the Sleuth's API by looking at the `org.springframework.cloud.sleuth.brave.bridge` module.
\ No newline at end of file
diff --git a/docs/src/main/asciidoc/integrations.adoc b/docs/src/main/asciidoc/integrations.adoc
index 8eaa29b86..74b7e84a1 100644
--- a/docs/src/main/asciidoc/integrations.adoc
+++ b/docs/src/main/asciidoc/integrations.adoc
@@ -13,7 +13,7 @@ In this section, we describe how to customize asynchronous communication with Sp
[[sleuth-async-annotation-integration]]
=== `@Async` Annotated methods
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
In Spring Cloud Sleuth, we instrument async-related components so that the tracing information is passed between threads.
You can disable this behavior by setting the value of `spring.sleuth.async.enabled` to `false`.
@@ -27,7 +27,7 @@ If you annotate your method with `@Async`, we automatically create a new Span wi
[[sleuth-async-scheduled-integration]]
=== `@Scheduled` Annotated Methods
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
In Spring Cloud Sleuth, we instrument scheduled method execution so that the tracing information is passed between threads.
You can disable this behavior by setting the value of `spring.sleuth.scheduled.enabled` to `false`.
@@ -42,7 +42,7 @@ If you want to skip span creation for some `@Scheduled` annotated classes, you c
[[sleuth-async-executor-service-integration]]
=== Executor, ExecutorService, and ScheduledExecutorService
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
We provide `LazyTraceExecutor`, `TraceableExecutorService`, and `TraceableScheduledExecutorService`.
Those implementations create spans each time a new task is submitted, invoked, or scheduled.
@@ -85,7 +85,7 @@ Features from this section can be disabled by setting the `spring.sleuth.web.cli
[[sleuth-http-client-rest-template-integration]]
=== Synchronous Rest Template
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
We inject a `RestTemplate` interceptor to ensure that all the tracing information is passed to the requests.
Each time a call is made, a new Span is created.
@@ -98,7 +98,7 @@ If you create a `RestTemplate` instance with a `new` keyword, the instrumentatio
[[sleuth-http-client-async-rest-template-integration]]
=== Asynchronous Rest Template
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
IMPORTANT: Starting with Sleuth `2.0.0`, we no longer register a bean of `AsyncRestTemplate` type.
It is up to you to create such a bean.
@@ -123,7 +123,7 @@ include::{common_tests_path}/src/main/java/org/springframework/cloud/sleuth/inst
[[sleuth-http-client-webclient-integration]]
==== `WebClient`
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
We inject a `ExchangeFilterFunction` implementation that creates a span and, through on-success and on-error callbacks, takes care of closing client-side spans.
@@ -135,7 +135,7 @@ If you create a `WebClient` instance with a `new` keyword, the instrumentation d
[[sleuth-http-client-traverson-integration]]
==== Traverson
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
If you use the https://docs.spring.io/spring-hateoas/docs/current/reference/html/#client.traverson[Traverson] library, you can inject a `RestTemplate` as a bean into your Traverson object.
Since `RestTemplate` is already intercepted, you get full support for tracing in your client.
@@ -162,7 +162,7 @@ To block these features, set `spring.sleuth.web.client.enabled` to `false`.
[[sleuth-http-client-netty-integration]]
==== Netty `HttpClient`
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
We instrument the Netty's `HttpClient`.
@@ -174,7 +174,7 @@ If you create a `HttpClient` instance with a `new` keyword, the instrumentation
[[sleuth-http-client-userinfo-integration]]
==== `UserInfoRestTemplateCustomizer`
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
We instrument the Spring Security's `UserInfoRestTemplateCustomizer`.
@@ -188,7 +188,7 @@ Features from this section can be disabled by setting the `spring.sleuth.web.ena
[[sleuth-http-server-http-filter-integration]]
=== HTTP Filter
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
Through the `TracingFilter`, all sampled incoming requests result in creation of a Span.
You can configure which URIs you would like to skip by setting the `spring.sleuth.web.skipPattern` property.
@@ -208,7 +208,7 @@ To disable the filter that logs uncaught exceptions you can disable the
[[sleuth-http-server-handler-interceptor-integration]]
=== HandlerInterceptor
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
Since we want the span names to be precise, we use a `TraceHandlerInterceptor` that either wraps an existing `HandlerInterceptor` or is added directly to the list of existing `HandlerInterceptors`.
The `TraceHandlerInterceptor` adds a special request attribute to the given `HttpServletRequest`.
@@ -219,14 +219,14 @@ In that case, please file an issue in Spring Cloud Sleuth.
[[sleuth-http-server-async-integration]]
=== Async Servlet support
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
If your controller returns a `Callable` or a `WebAsyncTask`, Spring Cloud Sleuth continues the existing span instead of creating a new one.
[[sleuth-http-server-webflux-integration]]
=== WebFlux support
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
Through `TraceWebFilter`, all sampled incoming requests result in creation of a Span.
That Span's name is `http:` + the path to which the request was sent.
@@ -255,7 +255,7 @@ Features from this section can be disabled by setting the `spring.sleuth.messagi
[[sleuth-messaging-spring-integration-integration]]
=== Spring Integration
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
Spring Cloud Sleuth integrates with https://projects.spring.io/spring-integration/[Spring Integration].
It creates spans for publish and subscribe events.
@@ -289,7 +289,7 @@ include::{common_tests_path}/src/main/java/org/springframework/cloud/sleuth/inst
[[sleuth-messaging-spring-cloud-function-integration]]
=== Spring Cloud Function and Spring Cloud Stream
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
Spring Cloud Sleuth can instrument Spring Cloud Function.
The way to achieve it is to provide a `Function` or `Consumer` or `Supplier` that takes in a `Message` as a parameter e.g. `Function, Message>`.
@@ -352,7 +352,7 @@ IMPORTANT: We don't support baggage propagation for JMS
[[sleuth-openfeign-integration]]
== OpenFeign
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
By default, Spring Cloud Sleuth provides integration with Feign through `TraceFeignClientAutoConfiguration`.
You can disable it entirely by setting `spring.sleuth.feign.enabled` to `false`.
@@ -366,7 +366,7 @@ However, all the default instrumentation is still there.
[[sleuth-opentracing-integration]]
== OpenTracing
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
Spring Cloud Sleuth is compatible with https://opentracing.io/[OpenTracing].
If you have OpenTracing on the classpath, we automatically register the OpenTracing `Tracer` bean.
@@ -375,7 +375,7 @@ If you wish to disable this, set `spring.sleuth.opentracing.enabled` to `false`
[[sleuth-quartz-integration]]
== Quartz
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
We instrument quartz jobs by adding Job/Trigger listeners to the Quartz Scheduler.
@@ -384,7 +384,7 @@ To turn off this feature, set the `spring.sleuth.quartz.enabled` property to `fa
[[sleuth-reactor-integration]]
== Reactor
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
We have three modes of instrumenting reactor based applications that can be set via `spring.sleuth.reactor.instrumentation-type` property:
@@ -417,7 +417,7 @@ To disable Redis support, set the `spring.sleuth.redis.enabled` property to `fal
[[sleuth-runnablecallable-integration]]
== Runnable and Callable
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
If you wrap your logic in `Runnable` or `Callable`, you can wrap those classes in their Sleuth representative, as shown in the following example for `Runnable`:
@@ -545,7 +545,7 @@ https://github.com/yidongnan/grpc-spring-boot-starter[Grpc Spring Boot Starter]
[[sleuth-rxjava-integration]]
== RxJava
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
We registering a custom https://github.com/ReactiveX/RxJava/wiki/Plugins#rxjavaschedulershook[`RxJavaSchedulersHook`] that wraps all `Action0` instances in their Sleuth representative, which is called `TraceAction`.
The hook either starts or continues a span, depending on whether tracing was already going on before the Action was scheduled.
@@ -559,7 +559,7 @@ IMPORTANT: The suggested approach to reactive programming and Sleuth is to use t
[[sleuth-circuitbreaker-integration]]
== Spring Cloud CircuitBreaker
-This feature is available for both Brave and OpenTelemetry tracer implementation.
+This feature is available for all tracer implementations.
If you have Spring Cloud CircuitBreaker on the classpath, we will wrap the passed command `Supplier` and the fallback `Function` in its trace representations.
In order to disable this instrumentation set `spring.sleuth.circuitbreaker.enabled` to `false`.
\ No newline at end of file
diff --git a/docs/src/main/asciidoc/project-features.adoc b/docs/src/main/asciidoc/project-features.adoc
index 08265124e..be53fcb11 100644
--- a/docs/src/main/asciidoc/project-features.adoc
+++ b/docs/src/main/asciidoc/project-features.adoc
@@ -21,7 +21,6 @@ To use the provided defaults you can set the `spring.sleuth.propagation.type` pr
The value can be a list in which case you will propagate more tracing headers.
For Brave we support `AWS`, `B3`, `W3C` propagation types.
-For OpenTelemetry we support `AWS`, `B3`, `JAEGER`, `OT_TRACER` and `W3C` via the `io.opentelemetry:opentelemetry-extension-trace-propagators` dependency that you have to manually add to your classpath.
You can read more about how to provide custom context propagation in this "<>".
@@ -249,30 +248,6 @@ You can integrate with Brave and https://opentracing.io/[OpenTracing] via the
`io.opentracing.brave:brave-opentracing` bridge.
Just add it to the classpath and the OpenTracing `Tracer` will be set up automatically.
-[[features-otel]]
-== OpenTelemetry Tracer Integration
-
-Spring Cloud Sleuth integrates with the OpenTelemetry (OTel in short) SDK tracer via the bridge that is available in the `spring-cloud-sleuth-otel` module.
-In this section you can read about specific OTel integrations.
-
-You can choose to use either Sleuth's API or the OpenTelemetry API directly in your code (e.g. either Sleuth's `Tracer` or OpenTelemetry's `Tracer`).
-If you want to use this tracer implementation's API directly please read https://github.com/open-telemetry/opentelemetry-java[their documentation to learn more about it].
-
-[[features-otel-logging]]
-=== OpenTelemetry Logging Integration
-
-We're providing an Slf4j integration via a `SpanProcessor` that injects to and removes entries (trace / span ids, baggage, tags etc.) from MDC. You can disable that via the `spring.sleuth.otel.log.slf4j.enabled=false` property.
-
-If it's there on the classpath, we integrate with the `LoggingSpanExporter`.
-You can disable that integration via the `spring.sleuth.otel.log.exporter.enabled=false` property.
-
-[[features-otel-opentracing]]
-=== OpenTelemetry Opentracing
-
-You can integrate with OpenTelemetry and https://opentracing.io/[OpenTracing] via the
-`io.opentelemetry:opentelemetry-opentracing-shim` bridge.
-Just add it to the classpath and the OpenTracing `Tracer` will be set up automatically.
-
[[features-zipkin]]
== Sending Spans to Zipkin
diff --git a/docs/src/main/asciidoc/using.adoc b/docs/src/main/asciidoc/using.adoc
index 99cca37fa..a776fe4b5 100644
--- a/docs/src/main/asciidoc/using.adoc
+++ b/docs/src/main/asciidoc/using.adoc
@@ -14,8 +14,8 @@ If you are starting out with {project-full-name}, you should probably read the
== Span Lifecycle with Spring Cloud Sleuth's API
Spring Cloud Sleuth Core in its `api` module contains all necessary interfaces to be implemented by a tracer.
-The project comes with OpenZipkin Brave and OpenTelemetry implementations.
-You can check how both tracers are bridged to the Sleuth's API by looking at the `org.springframework.cloud.sleuth.brave.bridge` and `org.springframework.cloud.sleuth.otel.bridge` modules respectively.
+The project comes with OpenZipkin Brave implementation.
+You can check how the tracers are bridged to the Sleuth's API by looking at the `org.springframework.cloud.sleuth.brave.bridge`.
The most commonly used interfaces are:
diff --git a/pom.xml b/pom.xml
index f91aa1397..b4e4edf3e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -49,7 +49,6 @@
spring-cloud-sleuth-api
spring-cloud-sleuth-instrumentation
spring-cloud-sleuth-brave
- spring-cloud-sleuth-otel
spring-cloud-sleuth-autoconfigure
tests
spring-cloud-sleuth-zipkin
@@ -73,9 +72,6 @@
3.0.0-SNAPSHOT
5.13.2
0.32.0
- 0.11.0
-
- 0.11.0
2.3.4.RELEASE
false
4.9.0
@@ -232,13 +228,6 @@
pom
import
-
- io.opentelemetry
- opentelemetry-bom
- ${opentelemetry.version}
- pom
- import
-
org.springframework.security.oauth.boot
spring-security-oauth2-autoconfigure
@@ -261,12 +250,6 @@
mockwebserver
${mockwebserver.version}
-
-
- io.opentelemetry.instrumentation
- opentelemetry-instrumentation-api
- ${opentelemetry-instrumentation.version}
-
org.springframework.security.oauth
spring-security-oauth2
@@ -297,35 +280,6 @@
-
-
-
- false
-
- bintray-open-telemetry-maven
- bintray
- https://dl.bintray.com/open-telemetry/maven
-
-
-
- true
-
- bintray-open-telemetry-maven-snapshot
- bintray
- https://oss.jfrog.org/oss-snapshot-local/
-
-
-
-
-
- false
-
- bintray-open-telemetry-maven
- bintray-plugins
- https://dl.bintray.com/open-telemetry/maven
-
-
-
spring
@@ -341,7 +295,7 @@
false
-
+
jfrog-snapshots
JFrog Snapshots
diff --git a/spring-cloud-sleuth-autoconfigure/pom.xml b/spring-cloud-sleuth-autoconfigure/pom.xml
index 870c25766..27c41903f 100644
--- a/spring-cloud-sleuth-autoconfigure/pom.xml
+++ b/spring-cloud-sleuth-autoconfigure/pom.xml
@@ -303,99 +303,12 @@
true
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
- true
-
-
- io.opentelemetry
- opentelemetry-api
- true
-
-
- io.opentelemetry
- opentelemetry-sdk-common
- true
-
-
- io.opentelemetry
- *
-
-
-
-
- io.opentelemetry
- opentelemetry-sdk-tracing
- true
-
-
- io.opentelemetry
- *
-
-
-
-
- io.opentelemetry.instrumentation
- opentelemetry-instrumentation-api
- true
-
-
- io.opentelemetry
- *
-
-
- io.opentelemetry.instrumentation
- *
-
-
-
-
- io.opentelemetry
- opentelemetry-exporter-logging
- true
-
-
- io.opentelemetry
- *
-
-
-
-
- io.opentelemetry
- opentelemetry-extension-trace-propagators
- true
-
-
- io.opentelemetry
- *
-
-
-
-
- io.opentelemetry
- opentelemetry-opentracing-shim
- true
-
-
- io.opentelemetry
- *
-
-
-
-
org.springframework.cloud
spring-cloud-sleuth-zipkin
true
-
- io.opentelemetry
- opentelemetry-exporter-zipkin
- true
-
io.zipkin.zipkin2
zipkin
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/SleuthTracerProperties.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/SleuthTracerProperties.java
index b7a3cf55e..1c0ff46e5 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/SleuthTracerProperties.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/SleuthTracerProperties.java
@@ -53,12 +53,7 @@ public class SleuthTracerProperties {
/**
* Picks the OpenZipkin Brave tracer implementation.
*/
- BRAVE,
-
- /**
- * Picks the OpenTelemetry tracer implementation.
- */
- OTEL
+ BRAVE
}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncAutoConfiguration.java
index 643a49ce3..4605e0c53 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncAutoConfiguration.java
@@ -22,7 +22,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.context.annotation.Configuration;
/**
@@ -36,7 +35,7 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnBean(Tracer.class)
@ConditionalOnProperty(value = "spring.sleuth.async.enabled", matchIfMissing = true)
@EnableConfigurationProperties(SleuthAsyncProperties.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
public class TraceAsyncAutoConfiguration {
}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncCustomAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncCustomAutoConfiguration.java
index 056f462a9..4ac599fd4 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncCustomAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncCustomAutoConfiguration.java
@@ -26,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.async.LazyTraceAsyncCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
@@ -45,7 +44,7 @@ import org.springframework.scheduling.annotation.AsyncConfigurer;
@AutoConfigureBefore(TraceAsyncDefaultAutoConfiguration.class)
@ConditionalOnProperty(value = "spring.sleuth.async.enabled", matchIfMissing = true)
@AutoConfigureAfter(name = "org.springframework.cloud.sleuth.instrument.scheduling.TraceSchedulingAutoConfiguration",
- value = { BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+ value = BraveAutoConfiguration.class)
public class TraceAsyncCustomAutoConfiguration implements BeanPostProcessor {
@Autowired
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncDefaultAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncDefaultAutoConfiguration.java
index 351983675..ae9ecffd2 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncDefaultAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/async/TraceAsyncDefaultAutoConfiguration.java
@@ -36,7 +36,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cloud.sleuth.SpanNamer;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.async.LazyTraceExecutor;
import org.springframework.cloud.sleuth.instrument.async.TraceAsyncAspect;
import org.springframework.context.annotation.Bean;
@@ -61,7 +60,7 @@ import org.springframework.scheduling.annotation.AsyncConfigurerSupport;
@EnableConfigurationProperties(SleuthAsyncProperties.class)
@ConditionalOnProperty(value = "spring.sleuth.async.enabled", matchIfMissing = true)
@ConditionalOnBean(Tracer.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
public class TraceAsyncDefaultAutoConfiguration {
@Bean
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/circuitbreaker/TraceCircuitBreakerAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/circuitbreaker/TraceCircuitBreakerAutoConfiguration.java
index 2df507fbc..7684a9b50 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/circuitbreaker/TraceCircuitBreakerAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/circuitbreaker/TraceCircuitBreakerAutoConfiguration.java
@@ -24,7 +24,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cloud.client.circuitbreaker.CircuitBreaker;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.circuitbreaker.TraceCircuitBreakerFactoryAspect;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -41,7 +40,7 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnBean(Tracer.class)
@ConditionalOnProperty(value = "spring.sleuth.circuitbreaker.enabled", matchIfMissing = true)
@EnableConfigurationProperties(SleuthCircuitBreakerProperties.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
public class TraceCircuitBreakerAutoConfiguration {
@Bean
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceFunctionAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceFunctionAutoConfiguration.java
index 05d749de5..1b9b03342 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceFunctionAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceFunctionAutoConfiguration.java
@@ -24,7 +24,6 @@ import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEven
import org.springframework.cloud.function.context.catalog.FunctionAroundWrapper;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.messaging.TraceFunctionAroundWrapper;
import org.springframework.cloud.sleuth.propagation.Propagator;
import org.springframework.context.annotation.Bean;
@@ -44,7 +43,7 @@ import org.springframework.messaging.support.MessageHeaderAccessor;
@ConditionalOnProperty(value = "spring.sleuth.function.enabled", matchIfMissing = true)
@ConditionalOnBean(Tracer.class)
@ConditionalOnClass({ FunctionAroundWrapper.class, RefreshScopeRefreshedEvent.class })
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
public class TraceFunctionAutoConfiguration {
@Bean
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceSpringIntegrationAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceSpringIntegrationAutoConfiguration.java
index e0a8a4e61..09cce5463 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceSpringIntegrationAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceSpringIntegrationAutoConfiguration.java
@@ -29,7 +29,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cloud.function.context.FunctionCatalog;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.messaging.DefaultMessageSpanCustomizer;
import org.springframework.cloud.sleuth.instrument.messaging.MessageSpanCustomizer;
import org.springframework.cloud.sleuth.instrument.messaging.TracingChannelInterceptor;
@@ -58,8 +57,7 @@ import org.springframework.util.StringUtils;
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(GlobalChannelInterceptor.class)
@ConditionalOnBean(Tracer.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class,
- TraceSpringMessagingAutoConfiguration.class })
+@AutoConfigureAfter({ BraveAutoConfiguration.class, TraceSpringMessagingAutoConfiguration.class })
@ConditionalOnProperty(value = "spring.sleuth.messaging.enabled", matchIfMissing = true)
@EnableConfigurationProperties(SleuthIntegrationMessagingProperties.class)
@Conditional(TracingChannelInterceptorCondition.class)
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceWebSocketAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceWebSocketAutoConfiguration.java
index 1a7c27208..313e3d9d9 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceWebSocketAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/messaging/TraceWebSocketAutoConfiguration.java
@@ -24,7 +24,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.messaging.DefaultMessageSpanCustomizer;
import org.springframework.cloud.sleuth.instrument.messaging.MessageSpanCustomizer;
import org.springframework.cloud.sleuth.instrument.messaging.TracingChannelInterceptor;
@@ -51,7 +50,7 @@ import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
@ConditionalOnClass(DelegatingWebSocketMessageBrokerConfiguration.class)
@ConditionalOnBean(Tracer.class)
@ConditionalOnProperty(value = "spring.sleuth.integration.websockets.enabled", matchIfMissing = true)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
class TraceWebSocketAutoConfiguration extends AbstractWebSocketMessageBrokerConfigurer {
@Autowired
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/quartz/TraceQuartzAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/quartz/TraceQuartzAutoConfiguration.java
index 7a14a39cf..24c3e9f4e 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/quartz/TraceQuartzAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/quartz/TraceQuartzAutoConfiguration.java
@@ -27,7 +27,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.quartz.TracingJobListener;
import org.springframework.cloud.sleuth.propagation.Propagator;
import org.springframework.context.annotation.Bean;
@@ -43,7 +42,7 @@ import org.springframework.context.annotation.Configuration;
@Configuration(proxyBeanMethods = false)
@ConditionalOnBean({ Tracer.class, Scheduler.class })
@ConditionalOnProperty(value = "spring.sleuth.quartz.enabled", matchIfMissing = true)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class, QuartzAutoConfiguration.class })
+@AutoConfigureAfter({ BraveAutoConfiguration.class, QuartzAutoConfiguration.class })
public class TraceQuartzAutoConfiguration implements InitializingBean {
private final Scheduler scheduler;
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/reactor/TraceReactorAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/reactor/TraceReactorAutoConfiguration.java
index a548ff0aa..e54d09928 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/reactor/TraceReactorAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/reactor/TraceReactorAutoConfiguration.java
@@ -41,7 +41,6 @@ import org.springframework.cloud.context.scope.refresh.RefreshScope;
import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.reactor.ReactorSleuth;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
@@ -63,7 +62,7 @@ import static org.springframework.cloud.sleuth.autoconfig.instrument.reactor.Tra
@ConditionalOnProperty(value = "spring.sleuth.reactor.enabled", matchIfMissing = true)
@ConditionalOnClass(Mono.class)
@AutoConfigureAfter(name = "org.springframework.cloud.sleuth.autoconfig.instrument.web.TraceWebAutoConfiguration",
- value = { BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+ value = BraveAutoConfiguration.class)
@EnableConfigurationProperties(SleuthReactorProperties.class)
public class TraceReactorAutoConfiguration {
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/rxjava/TraceRxJavaAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/rxjava/TraceRxJavaAutoConfiguration.java
index b2c1612fd..c3de23c9f 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/rxjava/TraceRxJavaAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/rxjava/TraceRxJavaAutoConfiguration.java
@@ -27,7 +27,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.rxjava.SleuthRxJavaSchedulersHook;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -44,7 +43,7 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(RxJavaSchedulersHook.class)
@ConditionalOnProperty(value = "spring.sleuth.rxjava.schedulers.hook.enabled", matchIfMissing = true)
@EnableConfigurationProperties(SleuthRxJavaSchedulersProperties.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
class TraceRxJavaAutoConfiguration {
@Bean
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/scheduling/TraceSchedulingAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/scheduling/TraceSchedulingAutoConfiguration.java
index 72a46d7b0..1cd5b7b33 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/scheduling/TraceSchedulingAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/scheduling/TraceSchedulingAutoConfiguration.java
@@ -25,7 +25,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.instrument.scheduling.TraceSchedulingAspect;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -43,7 +42,7 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnProperty(value = "spring.sleuth.scheduled.enabled", matchIfMissing = true)
@ConditionalOnBean(Tracer.class)
@EnableConfigurationProperties(SleuthSchedulingProperties.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
public class TraceSchedulingAutoConfiguration {
@Bean
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/TraceWebAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/TraceWebAutoConfiguration.java
index 22eb72fb1..0bbb5f248 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/TraceWebAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/TraceWebAutoConfiguration.java
@@ -21,7 +21,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
@@ -37,7 +36,7 @@ import org.springframework.context.annotation.Import;
@ConditionalOnSleuthWeb
@Import({ SkipPatternConfiguration.class, TraceWebFluxConfiguration.class, TraceWebServletConfiguration.class })
@EnableConfigurationProperties(SleuthWebProperties.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
public class TraceWebAutoConfiguration {
}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/TraceWebAsyncClientAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/TraceWebAsyncClientAutoConfiguration.java
index 9e4ad99f3..0638d66e6 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/TraceWebAsyncClientAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/TraceWebAsyncClientAutoConfiguration.java
@@ -30,7 +30,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.sleuth.CurrentTraceContext;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.http.HttpClientHandler;
import org.springframework.cloud.sleuth.instrument.web.mvc.TracingAsyncClientHttpRequestInterceptor;
import org.springframework.context.annotation.Bean;
@@ -52,7 +51,7 @@ import org.springframework.web.client.AsyncRestTemplate;
@ConditionalOnProperty(value = "spring.sleuth.web.async.client.enabled", matchIfMissing = true)
@ConditionalOnClass(AsyncRestTemplate.class)
@ConditionalOnBean(Tracer.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
public class TraceWebAsyncClientAutoConfiguration {
@Configuration(proxyBeanMethods = false)
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/TraceWebClientAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/TraceWebClientAutoConfiguration.java
index 5dfa08e9c..cc14fa30e 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/TraceWebClientAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/client/TraceWebClientAutoConfiguration.java
@@ -34,7 +34,6 @@ import org.springframework.cloud.gateway.filter.headers.HttpHeadersFilter;
import org.springframework.cloud.sleuth.CurrentTraceContext;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.http.HttpClientHandler;
import org.springframework.cloud.sleuth.instrument.web.client.HttpClientBeanPostProcessor;
import org.springframework.cloud.sleuth.instrument.web.client.LazyTraceClientHttpRequestInterceptor;
@@ -67,7 +66,7 @@ import org.springframework.web.reactive.function.client.WebClient;
@ConditionalnOnSleuthWebClient
@ConditionalOnBean(Tracer.class)
@AutoConfigureBefore(HttpClientConfiguration.class)
-@AutoConfigureAfter({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureAfter(BraveAutoConfiguration.class)
class TraceWebClientAutoConfiguration {
@Configuration(proxyBeanMethods = false)
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/ConditionalOnOtelEnabled.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/ConditionalOnOtelEnabled.java
deleted file mode 100644
index 1e0e3aefb..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/ConditionalOnOtelEnabled.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.springframework.boot.autoconfigure.condition.AnyNestedCondition;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Conditional;
-
-/**
- * Conditional on OTel tracer.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Conditional(AnyTracerModePropertySetCondition.class)
-public @interface ConditionalOnOtelEnabled {
-
-}
-
-final class AnyTracerModePropertySetCondition extends AnyNestedCondition {
-
- private AnyTracerModePropertySetCondition() {
- super(ConfigurationPhase.REGISTER_BEAN);
- }
-
- @ConditionalOnProperty(value = "spring.sleuth.tracer.mode", havingValue = "AUTO", matchIfMissing = true)
- static class OnAutoTracerMode {
-
- }
-
- @ConditionalOnProperty(value = "spring.sleuth.tracer.mode", havingValue = "OTEL")
- static class OnConcreteTracerMode {
-
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelAutoConfiguration.java
deleted file mode 100644
index b047291a3..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelAutoConfiguration.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import io.opentelemetry.api.OpenTelemetry;
-import io.opentelemetry.api.metrics.MeterProvider;
-import io.opentelemetry.api.trace.Tracer;
-import io.opentelemetry.api.trace.TracerProvider;
-import io.opentelemetry.context.propagation.ContextPropagators;
-import io.opentelemetry.sdk.trace.SpanProcessor;
-import io.opentelemetry.sdk.trace.TracerSdkProvider;
-import io.opentelemetry.sdk.trace.config.TraceConfig;
-import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor;
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-import io.opentelemetry.sdk.trace.spi.TracerProviderFactorySdk;
-import io.opentelemetry.spi.metrics.MeterProviderFactory;
-import io.opentelemetry.spi.trace.TracerProviderFactory;
-
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cloud.sleuth.autoconfig.SleuthAnnotationConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.SleuthBaggageProperties;
-import org.springframework.cloud.sleuth.autoconfig.SleuthSpanFilterProperties;
-import org.springframework.cloud.sleuth.autoconfig.SleuthTracerProperties;
-import org.springframework.cloud.sleuth.autoconfig.TraceConfiguration;
-import org.springframework.cloud.sleuth.internal.SleuthContextListener;
-import org.springframework.cloud.sleuth.otel.bridge.OtelOpenTelemetry;
-import org.springframework.cloud.sleuth.otel.bridge.SpanExporterCustomizer;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-/**
- * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
- * Auto-configuration} to enable tracing via Spring Cloud Sleuth and OpenTelemetry SDK.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass({ io.opentelemetry.api.trace.Tracer.class, OtelProperties.class })
-@ConditionalOnOtelEnabled
-@ConditionalOnProperty(value = "spring.sleuth.enabled", matchIfMissing = true)
-@ConditionalOnMissingBean(org.springframework.cloud.sleuth.Tracer.class)
-@EnableConfigurationProperties({ OtelProperties.class, SleuthSpanFilterProperties.class, SleuthBaggageProperties.class,
- SleuthTracerProperties.class })
-@Import({ OtelBridgeConfiguation.class, OtelPropagationConfiguration.class, TraceConfiguration.class,
- SleuthAnnotationConfiguration.class })
-public class OtelAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- OpenTelemetry otel(TracerProviderFactory tracerProviderFactory, MeterProviderFactory meterProviderFactory,
- TracerProvider tracerProvider, MeterProvider meterProvider, ContextPropagators contextPropagators) {
- OtelOpenTelemetry otelOpenTelemetry = new OtelOpenTelemetry(tracerProviderFactory, meterProviderFactory,
- tracerProvider, meterProvider, contextPropagators);
- OpenTelemetry.set(otelOpenTelemetry);
- OpenTelemetry.setGlobalPropagators(contextPropagators);
- return otelOpenTelemetry;
- }
-
- @Bean
- @ConditionalOnMissingBean
- TracerProviderFactory otelTracerProviderFactory() {
- return new TracerProviderFactorySdk();
- }
-
- @Bean
- @ConditionalOnMissingBean
- TracerProvider otelTracerProvider(TracerProviderFactory tracerProviderFactory) {
- return tracerProviderFactory.create();
- }
-
- @Bean
- @ConditionalOnMissingBean
- MeterProviderFactory otelMeterProviderFactory() {
- return OpenTelemetry::getGlobalMeterProvider;
- }
-
- @Bean
- @ConditionalOnMissingBean
- MeterProvider otelMeterProvider(MeterProviderFactory meterProviderFactory) {
- return meterProviderFactory.create();
- }
-
- @Bean
- @ConditionalOnMissingBean
- TraceConfig otelTracerConfig(OtelProperties otelProperties, Sampler sampler) {
- return TraceConfig.getDefault().toBuilder().setMaxLengthOfAttributeValues(otelProperties.getMaxAttrLength())
- .setMaxNumberOfAttributes(otelProperties.getMaxAttrs())
- .setMaxNumberOfAttributesPerEvent(otelProperties.getMaxEventAttrs())
- .setMaxNumberOfAttributesPerLink(otelProperties.getMaxLinkAttrs())
- .setMaxNumberOfEvents(otelProperties.getMaxEvents()).setMaxNumberOfLinks(otelProperties.getMaxLinks())
- .setSampler(sampler).build();
- }
-
- @Bean
- @ConditionalOnMissingBean
- Tracer otelTracer(TracerProvider tracerProvider, ObjectProvider tracerSdkObjectProvider,
- TraceConfig traceConfig, OtelProperties otelProperties, ObjectProvider> spanProcessors,
- ObjectProvider> spanExporters, SpanExporterCustomizer spanExporterCustomizer) {
- tracerSdkObjectProvider.ifAvailable(tracerSdkProvider -> {
- List processors = spanProcessors.getIfAvailable(ArrayList::new);
- processors.addAll(spanExporters.getIfAvailable(ArrayList::new).stream()
- .map(e -> SimpleSpanProcessor.builder(spanExporterCustomizer.customize(e)).build())
- .collect(Collectors.toList()));
- processors.forEach(tracerSdkProvider::addSpanProcessor);
- tracerSdkProvider.updateActiveTraceConfig(traceConfig);
- });
- return tracerProvider.get(otelProperties.getInstrumentationName());
- }
-
- @Bean
- @ConditionalOnMissingBean
- Sampler otelSampler(OtelProperties otelProperties) {
- return Sampler.traceIdRatioBased(otelProperties.getTraceIdRatioBased());
- }
-
- @Bean
- SleuthContextListener sleuthContextListener() {
- return new SleuthContextListener();
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelBridgeConfiguation.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelBridgeConfiguation.java
deleted file mode 100644
index 1b67b902c..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelBridgeConfiguation.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import java.util.regex.Pattern;
-
-import io.opentelemetry.api.OpenTelemetry;
-import io.opentelemetry.context.propagation.ContextPropagators;
-
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cloud.sleuth.CurrentTraceContext;
-import org.springframework.cloud.sleuth.SamplerFunction;
-import org.springframework.cloud.sleuth.SpanCustomizer;
-import org.springframework.cloud.sleuth.Tracer;
-import org.springframework.cloud.sleuth.autoconfig.SleuthBaggageProperties;
-import org.springframework.cloud.sleuth.autoconfig.instrument.web.ConditionalOnSleuthWeb;
-import org.springframework.cloud.sleuth.autoconfig.instrument.web.SleuthWebProperties;
-import org.springframework.cloud.sleuth.http.HttpClientHandler;
-import org.springframework.cloud.sleuth.http.HttpRequest;
-import org.springframework.cloud.sleuth.http.HttpRequestParser;
-import org.springframework.cloud.sleuth.http.HttpResponseParser;
-import org.springframework.cloud.sleuth.http.HttpServerHandler;
-import org.springframework.cloud.sleuth.instrument.web.HttpClientRequestParser;
-import org.springframework.cloud.sleuth.instrument.web.HttpClientResponseParser;
-import org.springframework.cloud.sleuth.instrument.web.HttpClientSampler;
-import org.springframework.cloud.sleuth.instrument.web.HttpServerRequestParser;
-import org.springframework.cloud.sleuth.instrument.web.HttpServerResponseParser;
-import org.springframework.cloud.sleuth.instrument.web.SkipPatternProvider;
-import org.springframework.cloud.sleuth.otel.bridge.OtelBaggageManager;
-import org.springframework.cloud.sleuth.otel.bridge.OtelCurrentTraceContext;
-import org.springframework.cloud.sleuth.otel.bridge.OtelHttpClientHandler;
-import org.springframework.cloud.sleuth.otel.bridge.OtelHttpServerHandler;
-import org.springframework.cloud.sleuth.otel.bridge.OtelPropagator;
-import org.springframework.cloud.sleuth.otel.bridge.OtelSpanCustomizer;
-import org.springframework.cloud.sleuth.otel.bridge.OtelTracer;
-import org.springframework.cloud.sleuth.otel.bridge.SkipPatternSampler;
-import org.springframework.cloud.sleuth.otel.bridge.SpanExporterCustomizer;
-import org.springframework.cloud.sleuth.propagation.Propagator;
-import org.springframework.context.ApplicationEventPublisher;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.lang.Nullable;
-
-/**
- * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
- * Auto-configuration} to enable the bridge between Sleuth API and OpenTelemetry.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass(OpenTelemetry.class)
-@Import({ OtelLogConfiguration.class, OtelExporterConfiguration.class })
-class OtelBridgeConfiguation {
-
- @Bean
- Tracer otelTracerBridge(io.opentelemetry.api.trace.Tracer tracer, ApplicationEventPublisher publisher,
- CurrentTraceContext currentTraceContext, SleuthBaggageProperties sleuthBaggageProperties) {
- return new OtelTracer(tracer, publisher, new OtelBaggageManager(currentTraceContext,
- sleuthBaggageProperties.getRemoteFields(), sleuthBaggageProperties.getTagFields(), publisher));
- }
-
- // Both CurrentTraceContext & ContextStorageProvider
- @Bean
- @ConditionalOnMissingBean
- OtelCurrentTraceContext otelCurrentTraceContext(ApplicationEventPublisher publisher) {
- return new OtelCurrentTraceContext(publisher);
- }
-
- @Bean
- SpanCustomizer otelSpanCustomizer() {
- return new OtelSpanCustomizer();
- }
-
- @Bean
- Propagator otelPropagator(ContextPropagators contextPropagators, io.opentelemetry.api.trace.Tracer tracer) {
- return new OtelPropagator(contextPropagators, tracer);
- }
-
- @Bean
- @ConditionalOnMissingBean
- SpanExporterCustomizer noOpSleuthSpanFilterConverter() {
- return new SpanExporterCustomizer() {
-
- };
- }
-
- @Configuration(proxyBeanMethods = false)
- @ConditionalOnSleuthWeb
- @EnableConfigurationProperties(SleuthWebProperties.class)
- static class TraceOtelHttpBridgeConfiguration {
-
- @Bean
- HttpClientHandler otelHttpClientHandler(io.opentelemetry.api.trace.Tracer tracer,
- @Nullable @HttpClientRequestParser HttpRequestParser httpClientRequestParser,
- @Nullable @HttpClientResponseParser HttpResponseParser httpClientResponseParser,
- SamplerFunction samplerFunction) {
- return new OtelHttpClientHandler(tracer, httpClientRequestParser, httpClientResponseParser,
- samplerFunction);
- }
-
- @Bean
- HttpServerHandler otelHttpServerHandler(io.opentelemetry.api.trace.Tracer tracer,
- @Nullable @HttpServerRequestParser HttpRequestParser httpServerRequestParser,
- @Nullable @HttpServerResponseParser HttpResponseParser httpServerResponseParser,
- ObjectProvider skipPatternProvider) {
- return new OtelHttpServerHandler(tracer, httpServerRequestParser, httpServerResponseParser,
- skipPatternProvider.getIfAvailable(() -> () -> Pattern.compile("")));
- }
-
- @Bean
- @ConditionalOnMissingBean(name = HttpClientSampler.NAME)
- SamplerFunction defaultHttpClientSampler(SleuthWebProperties sleuthWebProperties) {
- String skipPattern = sleuthWebProperties.getClient().getSkipPattern();
- if (skipPattern == null) {
- return SamplerFunction.deferDecision();
- }
- return new SkipPatternSampler(Pattern.compile(skipPattern));
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelExporterConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelExporterConfiguration.java
deleted file mode 100644
index bf471948b..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelExporterConfiguration.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import java.util.List;
-
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cloud.sleuth.exporter.SpanFilter;
-import org.springframework.cloud.sleuth.otel.bridge.CompositeSpanExporter;
-import org.springframework.cloud.sleuth.otel.bridge.SpanExporterCustomizer;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
- * Auto-configuration} to enable OpenTelemetry exporters.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass(SpanExporter.class)
-@EnableConfigurationProperties(OtelExporterProperties.class)
-class OtelExporterConfiguration {
-
- @Bean
- @ConditionalOnProperty(value = "spring.sleuth.otel.exporter.sleuth-span-filter.enabled", matchIfMissing = true)
- SpanExporterCustomizer sleuthSpanFilterConverter(List spanFilters) {
- return new SpanExporterCustomizer() {
- @Override
- public SpanExporter customize(SpanExporter spanExporter) {
- return new CompositeSpanExporter(spanExporter, spanFilters);
- }
- };
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelExporterProperties.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelExporterProperties.java
deleted file mode 100644
index 243e2a31b..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelExporterProperties.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * Sleuth settings for OpenTelemetry.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@ConfigurationProperties("spring.sleuth.otel.exporter")
-public class OtelExporterProperties {
-
- private SleuthSpanFilter sleuthSpanFilter = new SleuthSpanFilter();
-
- public SleuthSpanFilter getSleuthSpanFilter() {
- return this.sleuthSpanFilter;
- }
-
- public void setSleuthSpanFilter(SleuthSpanFilter sleuthSpanFilter) {
- this.sleuthSpanFilter = sleuthSpanFilter;
- }
-
- /**
- * Integrations with core Sleuth handler mechanism.
- */
- public static class SleuthSpanFilter {
-
- /**
- * Enables Sleuth span filter.
- */
- private boolean enabled = true;
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelLogConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelLogConfiguration.java
deleted file mode 100644
index b741d5074..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelLogConfiguration.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import io.opentelemetry.exporter.logging.LoggingSpanExporter;
-import org.slf4j.MDC;
-
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cloud.sleuth.autoconfig.SleuthBaggageProperties;
-import org.springframework.cloud.sleuth.otel.bridge.Slf4jBaggageSpanProcessor;
-import org.springframework.cloud.sleuth.otel.bridge.Slf4jSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
- * Auto-configuration} to enable logging configuration via Spring Cloud Sleuth and
- * OpenTelemetry SDK.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@Configuration(proxyBeanMethods = false)
-@EnableConfigurationProperties(OtelLogProperties.class)
-class OtelLogConfiguration {
-
- @Configuration(proxyBeanMethods = false)
- @ConditionalOnClass(MDC.class)
- @ConditionalOnProperty(value = "spring.sleuth.otel.log.slf4j.enabled", matchIfMissing = true)
- static class Slf4jConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- Slf4jSpanProcessor otelSlf4jSpanProcessor() {
- return new Slf4jSpanProcessor();
- }
-
- @Bean
- @ConditionalOnMissingBean
- Slf4jBaggageSpanProcessor otelSlf4jBaggageSpanProcessor(BeanFactory beanFactory,
- SleuthBaggageProperties baggageProperties) {
- return new Slf4jBaggageSpanProcessor(baggageProperties.getCorrelationFields(), beanFactory);
- }
-
- }
-
- @Configuration(proxyBeanMethods = false)
- @ConditionalOnClass(LoggingSpanExporter.class)
- @ConditionalOnProperty("spring.sleuth.otel.log.exporter.enabled")
- static class LoggingExporterConfiguration {
-
- @Bean
- LoggingSpanExporter otelLoggingSpanExporter() {
- return new LoggingSpanExporter();
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelLogProperties.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelLogProperties.java
deleted file mode 100644
index 2021851db..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelLogProperties.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * Sleuth settings for OpenTelemetry.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@ConfigurationProperties("spring.sleuth.otel.log")
-public class OtelLogProperties {
-
- private Exporter exporter = new Exporter();
-
- private Slf4j slf4j = new Slf4j();
-
- public Exporter getExporter() {
- return this.exporter;
- }
-
- public void setExporter(Exporter exporter) {
- this.exporter = exporter;
- }
-
- public Slf4j getSlf4j() {
- return this.slf4j;
- }
-
- public void setSlf4j(Slf4j slf4j) {
- this.slf4j = slf4j;
- }
-
- public static class Exporter {
-
- /**
- * Enable log exporter for OTel.
- */
- private boolean enabled = false;
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- }
-
- public static class Slf4j {
-
- /**
- * Enable slf4j support for OTel.
- */
- private boolean enabled;
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfiguration.java
deleted file mode 100644
index 70b5feb96..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfiguration.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.annotation.Nullable;
-
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.propagation.ContextPropagators;
-import io.opentelemetry.context.propagation.DefaultContextPropagators;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cloud.sleuth.BaggageManager;
-import org.springframework.cloud.sleuth.autoconfig.SleuthBaggageProperties;
-import org.springframework.cloud.sleuth.otel.propagation.BaggageTextMapPropagator;
-import org.springframework.cloud.sleuth.otel.propagation.CompositeTextMapPropagator;
-import org.springframework.cloud.sleuth.otel.propagation.PropagationType;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Condition;
-import org.springframework.context.annotation.ConditionContext;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.type.AnnotatedTypeMetadata;
-
-/**
- * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
- * Auto-configuration} to enable propagation configuration via Spring Cloud Sleuth and
- * OpenTelemetry SDK.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@Configuration(proxyBeanMethods = false)
-@EnableConfigurationProperties({ SleuthPropagationProperties.class, OtelPropagationProperties.class })
-class OtelPropagationConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- ContextPropagators otelContextPropagators(ObjectProvider> propagators) {
- List mapPropagators = propagators.getIfAvailable(ArrayList::new);
- if (mapPropagators.isEmpty()) {
- return noOpContextPropagator();
- }
- DefaultContextPropagators.Builder builder = DefaultContextPropagators.builder();
- mapPropagators.forEach(builder::addTextMapPropagator);
- return builder.build();
- }
-
- private ContextPropagators noOpContextPropagator() {
- return () -> new TextMapPropagator() {
- @Override
- public List fields() {
- return Collections.emptyList();
- }
-
- @Override
- public void inject(Context context, @Nullable C carrier, Setter setter) {
-
- }
-
- @Override
- public Context extract(Context context, @Nullable C carrier, Getter getter) {
- return context;
- }
- };
- }
-
- @Configuration(proxyBeanMethods = false)
- @ConditionalOnProperty(name = "spring.sleuth.otel.propagation.composite-text-map-propagator.enabled",
- matchIfMissing = true)
- static class PropagatorsConfiguration {
-
- @Bean
- TextMapPropagator compositeTextMapPropagator(BeanFactory beanFactory, SleuthPropagationProperties properties) {
- return new CompositeTextMapPropagator(beanFactory, properties.getType());
- }
-
- }
-
- @Configuration(proxyBeanMethods = false)
- @Conditional(B3PresentOrPropertyEnabledCondition.class)
- static class BaggagePropagatorConfiguration {
-
- @Bean
- TextMapPropagator baggageTextMapPropagator(SleuthBaggageProperties properties, BaggageManager baggageManager) {
- return new BaggageTextMapPropagator(properties.getRemoteFields(), baggageManager);
- }
-
- }
-
- static class B3PresentOrPropertyEnabledCondition implements Condition {
-
- @Override
- public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
- String type = context.getEnvironment()
- .getProperty("spring.sleuth.propagation.type", PropagationType.B3.toString()).toLowerCase();
- boolean sleuthBaggageEnabled = context.getEnvironment()
- .getProperty("spring.sleuth.otel.propagation.sleuth-baggage.enabled", Boolean.class, false);
- return type.contains(PropagationType.B3.toString().toLowerCase()) || sleuthBaggageEnabled;
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationProperties.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationProperties.java
deleted file mode 100644
index b64e9db28..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationProperties.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * Sleuth settings for OpenTelemetry propagation.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@ConfigurationProperties("spring.sleuth.otel.propagation")
-public class OtelPropagationProperties {
-
- private SleuthBaggage sleuthBaggage = new SleuthBaggage();
-
- public SleuthBaggage getSleuthBaggage() {
- return this.sleuthBaggage;
- }
-
- public void setSleuthBaggage(SleuthBaggage sleuthBaggage) {
- this.sleuthBaggage = sleuthBaggage;
- }
-
- public static class SleuthBaggage {
-
- /**
- * Enables default B3 Sleuth Baggage propagation. This will be automatically
- * turned on when B3 propagation type gets picked.
- */
- private boolean enabled;
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelProperties.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelProperties.java
deleted file mode 100644
index d20404d40..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelProperties.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.sdk.trace.config.TraceConfig;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * Sleuth settings for OpenTelemetry.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@ConfigurationProperties("spring.sleuth.otel.config")
-public class OtelProperties {
-
- /**
- * Instrumentation name to be used to find a Tracer.
- */
- private String instrumentationName = "org.springframework.cloud.spring-cloud-sleuth";
-
- /**
- * Instrumentation version to be used to find a Tracer.
- */
- private String instrumentationVersion;
-
- /**
- * Sets the global default {@code Sampler} value.
- */
- private double traceIdRatioBased = 0.1;
-
- /**
- * Returns the global default max number of attributes per {@link Span}.
- */
- private int maxAttrs = TraceConfig.getDefault().getMaxNumberOfAttributes();
-
- /**
- * Returns the global default max number of events per {@link Span}.
- */
- private int maxEvents = TraceConfig.getDefault().getMaxNumberOfEvents();
-
- /**
- * Returns the global default max number of link entries per {@link Span}.
- */
- private int maxLinks = TraceConfig.getDefault().getMaxNumberOfLinks();
-
- /**
- * Returns the global default max number of attributes per event.
- */
- private int maxEventAttrs = TraceConfig.getDefault().getMaxNumberOfAttributesPerEvent();
-
- /**
- * Returns the global default max number of attributes per link.
- */
- private int maxLinkAttrs = TraceConfig.getDefault().getMaxNumberOfAttributesPerLink();
-
- /**
- * Returns the global default max length of string attribute value in characters.
- */
- private int maxAttrLength = TraceConfig.getDefault().getMaxLengthOfAttributeValues();
-
- public String getInstrumentationName() {
- return this.instrumentationName;
- }
-
- public void setInstrumentationName(String instrumentationName) {
- this.instrumentationName = instrumentationName;
- }
-
- public String getInstrumentationVersion() {
- return instrumentationVersion;
- }
-
- public void setInstrumentationVersion(String instrumentationVersion) {
- this.instrumentationVersion = instrumentationVersion;
- }
-
- public double getTraceIdRatioBased() {
- return this.traceIdRatioBased;
- }
-
- public void setTraceIdRatioBased(int traceIdRatioBased) {
- this.traceIdRatioBased = traceIdRatioBased;
- }
-
- public int getMaxAttrs() {
- return this.maxAttrs;
- }
-
- public void setMaxAttrs(int maxAttrs) {
- this.maxAttrs = maxAttrs;
- }
-
- public int getMaxEvents() {
- return this.maxEvents;
- }
-
- public void setMaxEvents(int maxEvents) {
- this.maxEvents = maxEvents;
- }
-
- public int getMaxLinks() {
- return this.maxLinks;
- }
-
- public void setMaxLinks(int maxLinks) {
- this.maxLinks = maxLinks;
- }
-
- public int getMaxEventAttrs() {
- return this.maxEventAttrs;
- }
-
- public void setMaxEventAttrs(int maxEventAttrs) {
- this.maxEventAttrs = maxEventAttrs;
- }
-
- public int getMaxLinkAttrs() {
- return this.maxLinkAttrs;
- }
-
- public void setMaxLinkAttrs(int maxLinkAttrs) {
- this.maxLinkAttrs = maxLinkAttrs;
- }
-
- public int getMaxAttrLength() {
- return this.maxAttrLength;
- }
-
- public void setMaxAttrLength(int maxAttrLength) {
- this.maxAttrLength = maxAttrLength;
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/SleuthPropagationProperties.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/SleuthPropagationProperties.java
deleted file mode 100644
index 9a9c09469..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/SleuthPropagationProperties.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.cloud.sleuth.otel.propagation.PropagationType;
-
-/**
- * Sleuth propagation types.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-@ConfigurationProperties("spring.sleuth.propagation")
-public class SleuthPropagationProperties {
-
- /**
- * Tracing context propagation types.
- */
- private List type = Collections.singletonList(PropagationType.B3);
-
- public List getType() {
- return this.type;
- }
-
- public void setType(List type) {
- this.type = type;
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/instrument/opentracing/OtelOpentracingAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/instrument/opentracing/OtelOpentracingAutoConfiguration.java
deleted file mode 100644
index f54c082b1..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/otel/instrument/opentracing/OtelOpentracingAutoConfiguration.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel.instrument.opentracing;
-
-import io.opentelemetry.api.OpenTelemetry;
-import io.opentelemetry.opentracingshim.OpenTracingShim;
-import io.opentracing.Tracer;
-
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.cloud.sleuth.autoconfig.SleuthOpentracingProperties;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
- * Auto-configuration} to enable tracing via Opentracing.
- *
- * @author Spencer Gibb
- * @author Marcin Grzejszczak
- * @since 2.0.0
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(value = "spring.sleuth.opentracing.enabled", matchIfMissing = true)
-@ConditionalOnBean(OpenTelemetry.class)
-@ConditionalOnClass(OpenTracingShim.class)
-@AutoConfigureAfter(OtelAutoConfiguration.class)
-@EnableConfigurationProperties(SleuthOpentracingProperties.class)
-public class OtelOpentracingAutoConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- Tracer sleuthOpenTracing(OpenTelemetry openTelemetry) {
- return OpenTracingShim.createTracerShim(openTelemetry);
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/ZipkinAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/ZipkinAutoConfiguration.java
index a124e1f62..99c3ba13a 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/ZipkinAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/ZipkinAutoConfiguration.java
@@ -45,7 +45,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.cloud.commons.util.InetUtils;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.zipkin2.DefaultEndpointLocator;
import org.springframework.cloud.sleuth.zipkin2.DefaultZipkinRestTemplateCustomizer;
import org.springframework.cloud.sleuth.zipkin2.EndpointLocator;
@@ -76,9 +75,8 @@ import org.springframework.web.client.RestTemplate;
@ConditionalOnClass({ Sender.class, EndpointLocator.class })
@ConditionalOnProperty(value = { "spring.sleuth.enabled", "spring.zipkin.enabled" }, matchIfMissing = true)
@AutoConfigureAfter(name = "org.springframework.cloud.autoconfigure.RefreshAutoConfiguration")
-@AutoConfigureBefore({ OtelAutoConfiguration.class, BraveAutoConfiguration.class })
-@Import({ ZipkinSenderConfigurationImportSelector.class, ZipkinBraveConfiguration.class,
- ZipkinOtelConfiguration.class })
+@AutoConfigureBefore(BraveAutoConfiguration.class)
+@Import({ ZipkinSenderConfigurationImportSelector.class, ZipkinBraveConfiguration.class })
public class ZipkinAutoConfiguration {
/**
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/ZipkinOtelConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/ZipkinOtelConfiguration.java
deleted file mode 100644
index 1e45889f1..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/zipkin2/ZipkinOtelConfiguration.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.zipkin2;
-
-import io.opentelemetry.api.trace.Tracer;
-import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter;
-import zipkin2.reporter.Sender;
-
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.cloud.sleuth.zipkin2.DefaultZipkinRestTemplateCustomizer;
-import org.springframework.cloud.sleuth.zipkin2.EndpointLocator;
-import org.springframework.cloud.sleuth.zipkin2.ZipkinProperties;
-import org.springframework.cloud.sleuth.zipkin2.ZipkinRestTemplateCustomizer;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.env.Environment;
-import org.springframework.util.StringUtils;
-import org.springframework.web.client.RestTemplate;
-
-/**
- * {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
- * Auto-configuration} enables reporting to Zipkin via HTTP.
- *
- * The {@link ZipkinRestTemplateCustomizer} allows you to customize the
- * {@link RestTemplate} that is used to send Spans to Zipkin. Its default implementation -
- * {@link DefaultZipkinRestTemplateCustomizer} adds the GZip compression.
- *
- * @author Spencer Gibb
- * @author Tim Ysewyn
- * @since 1.0.0
- * @see ZipkinRestTemplateCustomizer
- * @see DefaultZipkinRestTemplateCustomizer
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(value = { "spring.sleuth.enabled", "spring.zipkin.enabled" }, matchIfMissing = true)
-@ConditionalOnClass({ Tracer.class, EndpointLocator.class })
-class ZipkinOtelConfiguration {
-
- @Configuration(proxyBeanMethods = false)
- @ConditionalOnClass(ZipkinSpanExporter.class)
- static class ZipkinConfiguration {
-
- @Bean
- @ConditionalOnMissingBean
- ZipkinSpanExporter otelZipkinSpanExporter(ZipkinProperties zipkinProperties,
- @Qualifier(ZipkinAutoConfiguration.SENDER_BEAN_NAME) Sender sender, Environment env) {
- return ZipkinSpanExporter.builder().setEndpoint(zipkinProperties.getBaseUrl() + "api/v2/spans")
- .setSender(sender).setEncoder(zipkinProperties.getEncoder())
- .setServiceName(
- StringUtils.hasText(zipkinProperties.getService().getName())
- ? zipkinProperties.getService().getName()
- : env.getProperty("spring.application.name", env.getProperty(
- "spring.zipkin.service.name", ZipkinSpanExporter.DEFAULT_SERVICE_NAME)))
- .build();
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
index 20a8ce3dd..d655251ff 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
+++ b/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -35,18 +35,6 @@
"description": "Enable instrumenting of Spring Cloud Function and Spring Cloud Function based projects (e.g. Spring Cloud Stream).",
"defaultValue": true
},
- {
- "name": "spring.sleuth.otel.propagation.sleuth-baggage.enabled",
- "type": "java.lang.Boolean",
- "description": "Enable propagating baggage in a Sleuth compatible way (baggage key & value pair means e.g. a key & value HTTP pair).",
- "defaultValue": true
- },
- {
- "name": "spring.sleuth.otel.propagation.composite-text-map-propagator.enabled",
- "type": "java.lang.Boolean",
- "description": "Enable a composite text map propagator that can combine multiple propagation types into a single text map propagator.",
- "defaultValue": true
- },
{
"name": "spring.sleuth.integration.websockets.enabled",
"type": "java.lang.Boolean",
diff --git a/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF/spring.factories
index 85f8abbf4..1c5ba3eba 100644
--- a/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF/spring.factories
+++ b/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF/spring.factories
@@ -25,8 +25,6 @@ org.springframework.cloud.sleuth.autoconfig.brave.instrument.messaging.BraveMess
org.springframework.cloud.sleuth.autoconfig.brave.instrument.opentracing.BraveOpentracingAutoConfiguration,\
org.springframework.cloud.sleuth.autoconfig.brave.instrument.redis.BraveRedisAutoConfiguration,\
org.springframework.cloud.sleuth.autoconfig.brave.instrument.mongodb.BraveMongoDbAutoConfiguration,\
-org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration,\
-org.springframework.cloud.sleuth.autoconfig.otel.instrument.opentracing.OtelOpentracingAutoConfiguration,\
org.springframework.cloud.sleuth.autoconfig.zipkin2.ZipkinAutoConfiguration
# Environment Post Processor
org.springframework.boot.env.EnvironmentPostProcessor=\
diff --git a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/TraceNoOpAutoConfiguration.java b/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/TraceNoOpAutoConfiguration.java
index 3d0d47ede..6b94213f1 100644
--- a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/TraceNoOpAutoConfiguration.java
+++ b/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/TraceNoOpAutoConfiguration.java
@@ -25,7 +25,6 @@ import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration;
import org.springframework.cloud.sleuth.autoconfig.instrument.web.ConditionalOnSleuthWeb;
import org.springframework.cloud.sleuth.autoconfig.instrument.web.client.ConditionalnOnSleuthWebClient;
-import org.springframework.cloud.sleuth.autoconfig.otel.OtelAutoConfiguration;
import org.springframework.cloud.sleuth.http.HttpClientHandler;
import org.springframework.cloud.sleuth.http.HttpServerHandler;
import org.springframework.cloud.sleuth.propagation.Propagator;
@@ -44,7 +43,7 @@ import org.springframework.context.annotation.Import;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty("spring.sleuth.noop.enabled")
-@AutoConfigureBefore({ BraveAutoConfiguration.class, OtelAutoConfiguration.class })
+@AutoConfigureBefore(BraveAutoConfiguration.class)
@Import(TraceConfiguration.class)
public class TraceNoOpAutoConfiguration {
diff --git a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/brave/ArchitectureTests.java b/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/brave/ArchitectureTests.java
deleted file mode 100644
index c991704ce..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/brave/ArchitectureTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.brave;
-
-import com.tngtech.archunit.junit.AnalyzeClasses;
-import com.tngtech.archunit.junit.ArchTest;
-import com.tngtech.archunit.lang.ArchRule;
-
-import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
-
-@AnalyzeClasses(packagesOf = ArchitectureTests.class)
-public class ArchitectureTests {
-
- @ArchTest
- public static final ArchRule should_not_contain_any_reference_to_other_tracers = noClasses().should()
- .dependOnClassesThat().resideInAnyPackage("..org.springframework.cloud.sleuth.otel..",
- "..org.springframework.cloud.sleuth.autoconfig.otel..", "..io.opentelemetry..");
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/otel/ArchitectureTests.java b/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/otel/ArchitectureTests.java
deleted file mode 100644
index c756feee9..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/otel/ArchitectureTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import com.tngtech.archunit.junit.AnalyzeClasses;
-import com.tngtech.archunit.junit.ArchTest;
-import com.tngtech.archunit.lang.ArchRule;
-
-import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
-
-@AnalyzeClasses(packagesOf = ArchitectureTests.class)
-public class ArchitectureTests {
-
- @ArchTest
- public static final ArchRule should_not_contain_any_reference_to_other_tracers = noClasses().should()
- .dependOnClassesThat().resideInAnyPackage("..org.springframework.cloud.sleuth.brave..",
- "..org.springframework.cloud.sleuth.autoconfig.brave..", "brave..");
-
-}
diff --git a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfigurationTests.java b/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfigurationTests.java
deleted file mode 100644
index a975645ae..000000000
--- a/spring-cloud-sleuth-autoconfigure/src/test/java/org/springframework/cloud/sleuth/autoconfig/otel/OtelPropagationConfigurationTests.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.autoconfig.otel;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Nullable;
-
-import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.TraceFlags;
-import io.opentelemetry.api.trace.TraceState;
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-import org.junit.jupiter.api.Test;
-
-import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
-import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-import org.springframework.cloud.gateway.config.GatewayAutoConfiguration;
-import org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration;
-import org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration;
-import org.springframework.cloud.sleuth.otel.propagation.CompositeTextMapPropagator;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-class OtelPropagationConfigurationTests {
-
- @Test
- void should_start_a_composite_text_map_propagator_with_b3_as_default() {
- ApplicationContextRunner runner = new ApplicationContextRunner()
- .withPropertyValues("spring.sleuth.tracer.mode=OTEL").withUserConfiguration(Config.class);
-
- runner.run(context -> {
- assertThat(context).hasNotFailed();
- CompositeTextMapPropagator propagator = context.getBean(CompositeTextMapPropagator.class);
- assertThat(propagator.fields()).contains("X-B3-TraceId");
- });
- }
-
- @Test
- void should_start_a_composite_text_map_propagator_with_a_single_propagation_type() {
- ApplicationContextRunner runner = new ApplicationContextRunner().withUserConfiguration(Config.class)
- .withPropertyValues("spring.sleuth.tracer.mode=OTEL")
- .withPropertyValues("spring.sleuth.propagation.type=w3c");
-
- runner.run(context -> {
- assertThat(context).hasNotFailed();
- CompositeTextMapPropagator propagator = context.getBean(CompositeTextMapPropagator.class);
- assertThat(propagator.fields()).doesNotContain("X-B3-TraceId").contains("traceparent");
- });
- }
-
- @Test
- void should_start_a_composite_text_map_propagator_with_multiple_propagation_types() {
- ApplicationContextRunner runner = new ApplicationContextRunner().withUserConfiguration(Config.class)
- .withPropertyValues("spring.sleuth.tracer.mode=OTEL")
- .withPropertyValues("spring.sleuth.propagation.type=b3,w3c");
-
- runner.run(context -> {
- assertThat(context).hasNotFailed();
- CompositeTextMapPropagator propagator = context.getBean(CompositeTextMapPropagator.class);
- assertThat(propagator.fields()).contains("X-B3-TraceId", "traceparent");
- });
- }
-
- @Test
- void should_start_a_composite_text_map_propagator_with_custom_propagation_types() {
- ApplicationContextRunner runner = new ApplicationContextRunner()
- .withUserConfiguration(CustomPropagatorConfig.class)
- .withPropertyValues("spring.sleuth.tracer.mode=OTEL")
- .withPropertyValues("spring.sleuth.propagation.type=custom");
-
- runner.run(context -> {
- assertThat(context).hasNotFailed();
- CompositeTextMapPropagator propagator = context.getBean(CompositeTextMapPropagator.class);
- assertThat(propagator.fields()).doesNotContain("myCustomTraceId", "myCustomSpanId", "X-B3-TraceId",
- "traceparent");
- });
- }
-
- @Test
- void should_inject_and_extract_from_custom_propagator() {
- CustomPropagator customPropagator = new CustomPropagator();
- Map carrier = carrierWithTracingData();
-
- // Extraction
- Context extract = customPropagator.extract(Context.current(), carrier,
- new TextMapPropagator.Getter
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
- ${project.version}
-
org.springframework.cloud
spring-cloud-sleuth-zipkin
@@ -98,14 +92,6 @@
-
-
- io.opentelemetry
- opentelemetry-bom
- ${opentelemetry.version}
- pom
- import
-
io.github.lognet
diff --git a/spring-cloud-sleuth-otel/pom.xml b/spring-cloud-sleuth-otel/pom.xml
deleted file mode 100644
index 01d8a26fd..000000000
--- a/spring-cloud-sleuth-otel/pom.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-otel
- jar
- Spring Cloud Sleuth OTel
- Spring Cloud Sleuth OpenTelemetry
-
-
- org.springframework.cloud
- spring-cloud-sleuth
- 3.0.0-SNAPSHOT
- ..
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
- org.springframework
- spring-jcl
-
-
- io.opentelemetry
- opentelemetry-api
-
-
- io.opentelemetry
- opentelemetry-sdk-common
-
-
- io.opentelemetry
- *
-
-
-
-
- io.opentelemetry
- opentelemetry-sdk-tracing
-
-
- io.opentelemetry
- *
-
-
-
-
- io.opentelemetry.instrumentation
- opentelemetry-instrumentation-api
-
-
- io.opentelemetry
- *
-
-
- io.opentelemetry.instrumentation
- *
-
-
-
-
- io.opentelemetry
- opentelemetry-exporter-logging
- true
-
-
- io.opentelemetry
- *
-
-
-
-
- io.opentelemetry
- opentelemetry-extension-trace-propagators
-
-
- io.opentelemetry
- *
-
-
-
-
- io.opentelemetry
- opentelemetry-opentracing-shim
- true
-
-
- io.opentelemetry
- *
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.assertj
- assertj-core
- test
-
-
- com.tngtech.archunit
- archunit-junit5
- test
-
-
-
-
-
- fast
-
- false
-
-
-
-
- maven-surefire-plugin
-
- 4
- true
- -Xmx1024m -XX:MaxPermSize=256m
-
-
-
-
-
-
-
-
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/ArrayListSpanProcessor.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/ArrayListSpanProcessor.java
deleted file mode 100644
index 90a95bfbb..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/ArrayListSpanProcessor.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.Collection;
-import java.util.Queue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import io.opentelemetry.context.Context;
-import io.opentelemetry.sdk.common.CompletableResultCode;
-import io.opentelemetry.sdk.trace.ReadWriteSpan;
-import io.opentelemetry.sdk.trace.ReadableSpan;
-import io.opentelemetry.sdk.trace.SpanProcessor;
-import io.opentelemetry.sdk.trace.data.SpanData;
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-
-/**
- * Stores spans in a queue.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class ArrayListSpanProcessor implements SpanProcessor, SpanExporter {
-
- Queue spans = new LinkedBlockingQueue<>(50);
-
- @Override
- public void onStart(Context parent, ReadWriteSpan span) {
-
- }
-
- @Override
- public boolean isStartRequired() {
- return false;
- }
-
- @Override
- public void onEnd(ReadableSpan span) {
- this.spans.add(span.toSpanData());
- }
-
- @Override
- public boolean isEndRequired() {
- return true;
- }
-
- @Override
- public CompletableResultCode export(Collection spans) {
- return CompletableResultCode.ofSuccess();
- }
-
- @Override
- public CompletableResultCode flush() {
- return CompletableResultCode.ofSuccess();
- }
-
- @Override
- public CompletableResultCode shutdown() {
- return CompletableResultCode.ofSuccess();
- }
-
- @Override
- public CompletableResultCode forceFlush() {
- return CompletableResultCode.ofSuccess();
- }
-
- public SpanData takeLocalSpan() {
- return this.spans.poll();
- }
-
- public Queue spans() {
- return this.spans;
- }
-
- public void clear() {
- this.spans.clear();
- }
-
- @Override
- public String toString() {
- return "ArrayListSpanProcessor{" + "spans=" + spans + '}';
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/BigendianEncoding.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/BigendianEncoding.java
deleted file mode 100644
index 85c3475a4..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/BigendianEncoding.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.Arrays;
-
-import io.opentelemetry.api.internal.Utils;
-
-/**
- * Copied from io.opentelemetry.api.trace.BigendianEncoding.
- */
-final class BigendianEncoding {
-
- static final int LONG_BYTES = Long.SIZE / Byte.SIZE;
- static final int BYTE_BASE16 = 2;
- static final int LONG_BASE16 = BYTE_BASE16 * LONG_BYTES;
-
- private static final String ALPHABET = "0123456789abcdef";
-
- private static final int ASCII_CHARACTERS = 128;
-
- private static final byte[] DECODING = buildDecodingArray();
-
- private BigendianEncoding() {
- }
-
- private static byte[] buildDecodingArray() {
- byte[] decoding = new byte[ASCII_CHARACTERS];
- Arrays.fill(decoding, (byte) -1);
- for (int i = 0; i < ALPHABET.length(); i++) {
- char c = ALPHABET.charAt(i);
- decoding[c] = (byte) i;
- }
- return decoding;
- }
-
- /**
- * Returns the {@code long} value whose base16 representation is stored in the first
- * 16 chars of {@code chars} starting from the {@code offset}.
- * @param chars the base16 representation of the {@code long}.
- */
- static long longFromBase16String(CharSequence chars) {
- return longFromBase16String(chars, 0);
- }
-
- /**
- * Returns the {@code long} value whose base16 representation is stored in the first
- * 16 chars of {@code chars} starting from the {@code offset}.
- * @param chars the base16 representation of the {@code long}.
- */
- static long longFromBase16String(CharSequence chars, int offset) {
- Utils.checkArgument(chars.length() >= offset + LONG_BASE16, "chars too small");
- return (decodeByte(chars.charAt(offset), chars.charAt(offset + 1)) & 0xFFL) << 56
- | (decodeByte(chars.charAt(offset + 2), chars.charAt(offset + 3)) & 0xFFL) << 48
- | (decodeByte(chars.charAt(offset + 4), chars.charAt(offset + 5)) & 0xFFL) << 40
- | (decodeByte(chars.charAt(offset + 6), chars.charAt(offset + 7)) & 0xFFL) << 32
- | (decodeByte(chars.charAt(offset + 8), chars.charAt(offset + 9)) & 0xFFL) << 24
- | (decodeByte(chars.charAt(offset + 10), chars.charAt(offset + 11)) & 0xFFL) << 16
- | (decodeByte(chars.charAt(offset + 12), chars.charAt(offset + 13)) & 0xFFL) << 8
- | (decodeByte(chars.charAt(offset + 14), chars.charAt(offset + 15)) & 0xFFL);
- }
-
- private static byte decodeByte(char hi, char lo) {
- Utils.checkArgument(lo < ASCII_CHARACTERS && DECODING[lo] != -1, "invalid character " + lo);
- Utils.checkArgument(hi < ASCII_CHARACTERS && DECODING[hi] != -1, "invalid character " + hi);
- int decoded = DECODING[hi] << 4 | DECODING[lo];
- return (byte) decoded;
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/CompositeSpanExporter.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/CompositeSpanExporter.java
deleted file mode 100644
index 74aaeb22d..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/CompositeSpanExporter.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import io.opentelemetry.sdk.common.CompletableResultCode;
-import io.opentelemetry.sdk.trace.data.SpanData;
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-
-import org.springframework.cloud.sleuth.exporter.SpanFilter;
-
-/**
- * Composes multiple {@link SpanFilter} into a single {@link SpanExporter}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class CompositeSpanExporter implements io.opentelemetry.sdk.trace.export.SpanExporter {
-
- private final io.opentelemetry.sdk.trace.export.SpanExporter delegate;
-
- private final List filters;
-
- public CompositeSpanExporter(io.opentelemetry.sdk.trace.export.SpanExporter delegate, List filters) {
- this.delegate = delegate;
- this.filters = filters;
- }
-
- @Override
- public CompletableResultCode export(Collection spans) {
- return this.delegate.export(spans.stream().filter(this::shouldProcess).collect(Collectors.toList()));
- }
-
- private boolean shouldProcess(SpanData span) {
- for (SpanFilter exporter : this.filters) {
- if (!exporter.isExportable(OtelFinishedSpan.fromOtel(span))) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public CompletableResultCode flush() {
- return this.delegate.flush();
- }
-
- @Override
- public CompletableResultCode shutdown() {
- return this.delegate.shutdown();
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelBaggageInScope.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelBaggageInScope.java
deleted file mode 100644
index 4e980274b..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelBaggageInScope.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
-
-import io.opentelemetry.api.baggage.Baggage;
-import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.Scope;
-
-import org.springframework.cloud.sleuth.BaggageInScope;
-import org.springframework.cloud.sleuth.CurrentTraceContext;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationEventPublisher;
-
-/**
- * OpenTelemetry implementation of a {@link BaggageInScope}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-class OtelBaggageInScope implements BaggageInScope {
-
- private final OtelBaggageManager otelBaggageManager;
-
- private final CurrentTraceContext currentTraceContext;
-
- private final ApplicationEventPublisher publisher;
-
- private final List tagFields;
-
- private final AtomicReference entry = new AtomicReference<>();
-
- private final AtomicReference scope = new AtomicReference<>();
-
- OtelBaggageInScope(OtelBaggageManager otelBaggageManager, CurrentTraceContext currentTraceContext,
- ApplicationEventPublisher publisher, List tagFields, Entry entry) {
- this.otelBaggageManager = otelBaggageManager;
- this.currentTraceContext = currentTraceContext;
- this.publisher = publisher;
- this.tagFields = tagFields;
- this.entry.set(entry);
- }
-
- @Override
- public String name() {
- return entry().getKey();
- }
-
- @Override
- public String get() {
- return this.otelBaggageManager.currentBaggage().getEntryValue(entry().getKey());
- }
-
- @Override
- public String get(TraceContext traceContext) {
- Entry entry = this.otelBaggageManager.getEntry((OtelTraceContext) traceContext, entry().getKey());
- if (entry == null) {
- return null;
- }
- return entry.getValue();
- }
-
- @Override
- public BaggageInScope set(String value) {
- return doSet(this.currentTraceContext.context(), value);
- }
-
- private BaggageInScope doSet(TraceContext context, String value) {
- Context current = Context.current();
- Span currentSpan = Span.current();
- io.opentelemetry.api.baggage.Baggage baggage;
- if (context != null) {
- OtelTraceContext ctx = (OtelTraceContext) context;
- Context storedCtx = ctx.context();
- Baggage fromContext = Baggage.fromContext(storedCtx);
- baggage = fromContext.toBuilder().setParent(current)
- .put(entry().getKey(), value, entry().getEntryMetadata()).build();
- current = baggage.storeInContext(current);
- ctx.updateContext(current);
- }
- else {
- baggage = Baggage.builder().put(entry().getKey(), value, entry().getEntryMetadata()).build();
- }
- Context withBaggage = current.with(baggage);
- this.scope.set(withBaggage.makeCurrent());
- if (this.tagFields.stream().map(String::toLowerCase).anyMatch(s -> s.equals(entry().getKey()))) {
- currentSpan.setAttribute(entry().getKey(), value);
- }
- this.publisher.publishEvent(new BaggageChanged(this, baggage, entry().getKey(), value));
- Entry previous = entry();
- this.entry.set(new Entry(previous.getKey(), value, previous.getEntryMetadata()));
- return this;
- }
-
- private Entry entry() {
- return this.entry.get();
- }
-
- @Override
- public BaggageInScope set(TraceContext traceContext, String value) {
- return doSet(traceContext, value);
- }
-
- @Override
- public BaggageInScope makeCurrent() {
- close();
- Entry entry = entry();
- Scope scope = Baggage.builder().put(entry.getKey(), entry.getValue(), entry.getEntryMetadata()).build()
- .makeCurrent();
- this.scope.set(scope);
- return this;
- }
-
- @Override
- public void close() {
- Scope scope = this.scope.get();
- if (scope != null) {
- this.scope.set(null);
- scope.close();
- }
- }
-
- static class BaggageChanged extends ApplicationEvent {
-
- /**
- * Baggage with the new entry.
- */
- Baggage baggage;
-
- /**
- * Baggage entry name.
- */
- String name;
-
- /**
- * Baggage entry value.
- */
- String value;
-
- BaggageChanged(OtelBaggageInScope source, Baggage baggage, String name, String value) {
- super(source);
- this.baggage = baggage;
- this.name = name;
- this.value = value;
- }
-
- @Override
- public String toString() {
- return "BaggageChanged{" + "name='" + name + '\'' + ", value='" + value + '\'' + '}';
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelBaggageManager.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelBaggageManager.java
deleted file mode 100644
index 913b4869f..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelBaggageManager.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-import io.opentelemetry.api.baggage.Baggage;
-import io.opentelemetry.api.baggage.BaggageBuilder;
-import io.opentelemetry.api.baggage.BaggageConsumer;
-import io.opentelemetry.api.baggage.EntryMetadata;
-import io.opentelemetry.context.Context;
-
-import org.springframework.cloud.sleuth.BaggageInScope;
-import org.springframework.cloud.sleuth.BaggageManager;
-import org.springframework.cloud.sleuth.CurrentTraceContext;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.Tracer;
-import org.springframework.context.ApplicationEventPublisher;
-
-/**
- * OpenTelemetry implementation of a {@link BaggageManager}. Doesn't implement an
- * interface cause {@link Tracer} already implements it.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class OtelBaggageManager implements BaggageManager {
-
- private final CurrentTraceContext currentTraceContext;
-
- private final List remoteFields;
-
- private final List tagFields;
-
- private final ApplicationEventPublisher publisher;
-
- public OtelBaggageManager(CurrentTraceContext currentTraceContext, List remoteFields,
- List tagFields, ApplicationEventPublisher publisher) {
- this.currentTraceContext = currentTraceContext;
- this.remoteFields = remoteFields;
- this.tagFields = tagFields;
- this.publisher = publisher;
- }
-
- @Override
- public Map getAllBaggage() {
- Map baggage = new HashMap<>();
- currentBaggage().getEntries().forEach(entry -> baggage.put(entry.getKey(), entry.getValue()));
- return baggage;
- }
-
- CompositeBaggage currentBaggage() {
- OtelTraceContext traceContext = (OtelTraceContext) currentTraceContext.context();
- Context context = Context.current();
- Deque stack = new ArrayDeque<>();
- if (traceContext != null) {
- stack.addFirst(traceContext.context());
- }
- stack.addFirst(context);
- return new CompositeBaggage(stack);
- }
-
- @Override
- public BaggageInScope getBaggage(String name) {
- Entry entry = getBaggage(name, currentBaggage());
- return createNewEntryIfMissing(name, entry);
- }
-
- BaggageInScope createNewEntryIfMissing(String name, Entry entry) {
- if (entry == null) {
- return createBaggage(name);
- }
- return otelBaggage(entry);
- }
-
- private Entry getBaggage(String name, io.opentelemetry.api.baggage.Baggage baggage) {
- return entryForName(name, baggage);
- }
-
- @Override
- public BaggageInScope getBaggage(TraceContext traceContext, String name) {
- OtelTraceContext context = (OtelTraceContext) traceContext;
- // TODO: Refactor
- Deque stack = new ArrayDeque<>();
- stack.addFirst(Context.current());
- stack.addFirst(context.context());
- Context ctx = removeFirst(stack);
- Entry entry = null;
- while (ctx != null && entry == null) {
- entry = getBaggage(name, Baggage.fromContext(ctx));
- ctx = removeFirst(stack);
- }
- return createNewEntryIfMissing(name, entry);
- }
-
- Entry getEntry(OtelTraceContext traceContext, String name) {
- OtelTraceContext context = traceContext;
- Context ctx = context.context();
- return getBaggage(name, Baggage.fromContext(ctx));
- }
-
- Context removeFirst(Deque stack) {
- return stack.isEmpty() ? null : stack.removeFirst();
- }
-
- private Entry entryForName(String name, io.opentelemetry.api.baggage.Baggage baggage) {
- return Entry.fromBaggage(baggage).stream().filter(e -> e.getKey().toLowerCase().equals(name.toLowerCase()))
- .findFirst().orElse(null);
- }
-
- private BaggageInScope otelBaggage(Entry entry) {
- return new OtelBaggageInScope(this, this.currentTraceContext, this.publisher, this.tagFields, entry);
- }
-
- @Override
- public BaggageInScope createBaggage(String name) {
- return createBaggage(name, "");
- }
-
- @Override
- public BaggageInScope createBaggage(String name, String value) {
- BaggageInScope baggageInScope = baggageWithValue(name, "");
- return baggageInScope.set(value);
- }
-
- private BaggageInScope baggageWithValue(String name, String value) {
- List remoteFieldsFields = this.remoteFields;
- boolean remoteField = remoteFieldsFields.stream().map(String::toLowerCase)
- .anyMatch(s -> s.equals(name.toLowerCase()));
- EntryMetadata entryMetadata = EntryMetadata.create(propagationString(remoteField));
- Entry entry = new Entry(name, value, entryMetadata);
- return new OtelBaggageInScope(this, this.currentTraceContext, this.publisher, this.tagFields, entry);
- }
-
- private String propagationString(boolean remoteField) {
- // TODO: [OTEL] Magic strings
- String propagation = "";
- if (remoteField) {
- propagation = "propagation=unlimited";
- }
- return propagation;
- }
-
-}
-
-class CompositeBaggage implements io.opentelemetry.api.baggage.Baggage {
-
- private final Deque stack;
-
- private final Collection entries;
-
- CompositeBaggage(Deque stack) {
- this.stack = stack;
- this.entries = getEntries();
- }
-
- Collection getEntries() {
- // parent baggage foo=bar
- // child baggage foo=baz - we want the last one to override the previous one
- Map map = new HashMap<>();
- Iterator iterator = this.stack.descendingIterator();
- while (iterator.hasNext()) {
- Context next = iterator.next();
- Baggage baggage = Baggage.fromContext(next);
- baggage.forEach((key, value, metadata) -> map.put(key, new Entry(key, value, metadata)));
- }
- return map.values();
- }
-
- @Override
- public int size() {
- return this.entries.size();
- }
-
- @Override
- public void forEach(BaggageConsumer consumer) {
- this.entries.forEach(entry -> consumer.accept(entry.getKey(), entry.getValue(), entry.getEntryMetadata()));
- }
-
- @Override
- public String getEntryValue(String entryKey) {
- return this.entries.stream().filter(entry -> entryKey.equals(entry.getKey())).map(Entry::getValue).findFirst()
- .orElse(null);
- }
-
- @Override
- public BaggageBuilder toBuilder() {
- return Baggage.builder();
- }
-
-}
-
-class Entry {
-
- final String key;
-
- final String value;
-
- final EntryMetadata entryMetadata;
-
- Entry(String key, String value, EntryMetadata entryMetadata) {
- this.key = key;
- this.value = value;
- this.entryMetadata = entryMetadata;
- }
-
- String getKey() {
- return this.key;
- }
-
- String getValue() {
- return this.value;
- }
-
- EntryMetadata getEntryMetadata() {
- return this.entryMetadata;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Entry entry = (Entry) o;
- return Objects.equals(this.key, entry.key) && Objects.equals(this.value, entry.value)
- && Objects.equals(this.entryMetadata, entry.entryMetadata);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(this.key, this.value, this.entryMetadata);
- }
-
- static List fromBaggage(Baggage baggage) {
- List list = new ArrayList<>(baggage.size());
- baggage.forEach((key, value, metadata) -> list.add(new Entry(key, value, metadata)));
- return list;
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelCurrentTraceContext.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelCurrentTraceContext.java
deleted file mode 100644
index 571bbd2b9..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelCurrentTraceContext.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-
-import io.opentelemetry.api.baggage.Baggage;
-import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.ContextStorage;
-import io.opentelemetry.context.ContextStorageProvider;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.cloud.sleuth.CurrentTraceContext;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationEventPublisher;
-import org.springframework.lang.Nullable;
-
-/**
- * OpenTelemetry implementation of a {@link CurrentTraceContext}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class OtelCurrentTraceContext implements CurrentTraceContext, ContextStorageProvider {
-
- private static final Log log = LogFactory.getLog(OtelCurrentTraceContext.class);
-
- private final ApplicationEventPublisher publisher;
-
- private final ContextStorageProvider delegate = ContextStorage::get;
-
- public OtelCurrentTraceContext(ApplicationEventPublisher publisher) {
- this.publisher = publisher;
- }
-
- @Override
- public TraceContext context() {
- Span currentSpan = Span.current();
- if (Span.getInvalid().equals(currentSpan)) {
- return null;
- }
- if (currentSpan instanceof SpanFromSpanContext) {
- return new OtelTraceContext((SpanFromSpanContext) currentSpan);
- }
- return new OtelTraceContext(currentSpan);
- }
-
- @Override
- public Scope newScope(TraceContext context) {
- OtelTraceContext otelTraceContext = (OtelTraceContext) context;
- if (otelTraceContext == null) {
- return io.opentelemetry.context.Scope::noop;
- }
- Context current = Context.current();
- Context old = otelTraceContext.context();
- Span currentSpan = Span.fromContext(current);
- Span oldSpan = Span.fromContext(otelTraceContext.context());
- SpanContext spanContext = otelTraceContext.delegate;
- boolean sameSpan = currentSpan.getSpanContext().equals(oldSpan.getSpanContext())
- && currentSpan.getSpanContext().equals(spanContext);
- Baggage currentBaggage = Baggage.fromContext(current);
- Baggage oldBaggage = Baggage.fromContext(old);
- boolean sameBaggage = sameBaggage(currentBaggage, oldBaggage);
- if (sameSpan && sameBaggage) {
- return io.opentelemetry.context.Scope::noop;
- }
- SpanFromSpanContext fromContext = new SpanFromSpanContext(((OtelTraceContext) context).span, spanContext,
- otelTraceContext);
- Context newContext = old.with(fromContext).with(currentBaggage.toBuilder().setParent(old).build());
- io.opentelemetry.context.Scope attach = get().attach(newContext);
- return attach::close;
- }
-
- private boolean sameBaggage(Baggage currentBaggage, Baggage oldBaggage) {
- Set entries = new HashSet<>(Entry.fromBaggage(currentBaggage));
- entries.removeAll(Entry.fromBaggage(oldBaggage));
- return entries.isEmpty();
- }
-
- @Override
- public Scope maybeScope(TraceContext context) {
- return newScope(context);
- }
-
- @Override
- public Callable wrap(Callable task) {
- return get().current().wrap(task);
- }
-
- @Override
- public Runnable wrap(Runnable task) {
- return get().current().wrap(task);
- }
-
- @Override
- public Executor wrap(Executor delegate) {
- return get().current().wrap(delegate);
- }
-
- @Override
- public ExecutorService wrap(ExecutorService delegate) {
- return get().current().wrap(delegate);
- }
-
- @Override
- public ContextStorage get() {
- ContextStorage threadLocalStorage = this.delegate.get();
- return new ContextStorage() {
- @Override
- public io.opentelemetry.context.Scope attach(Context toAttach) {
- io.opentelemetry.context.Scope scope = threadLocalStorage.attach(toAttach);
- Span currentSpan = Span.fromContext(Context.current());
- if (scope != io.opentelemetry.context.Scope.noop()) {
- Span fromContext = Span.fromContext(toAttach);
- publisher.publishEvent(new ScopeChanged(this, fromContext));
- }
- return () -> {
- publisher.publishEvent(new OtelCurrentTraceContext.ScopeClosed(this));
- publisher.publishEvent(new ScopeChanged(this, currentSpan));
- scope.close();
- };
- }
-
- @Override
- public Context current() {
- return threadLocalStorage.current();
- }
- };
- }
-
- static class ScopeChanged extends ApplicationEvent {
-
- /**
- * Span corresponding to the changed scope. Might be {@code null}.
- */
- final Span span;
-
- /**
- * Create a new {@code ApplicationEvent}.
- * @param source the object on which the event initially occurred or with which
- * the event is associated (never {@code null})
- * @param span corresponding trace context
- */
- ScopeChanged(Object source, @Nullable Span span) {
- super(source);
- this.span = span;
- }
-
- }
-
- static class ScopeClosed extends ApplicationEvent {
-
- /**
- * Create a new {@code ApplicationEvent}.
- * @param source the object on which the event initially occurred or with which
- * the event is associated (never {@code null})
- */
- ScopeClosed(Object source) {
- super(source);
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelFinishedSpan.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelFinishedSpan.java
deleted file mode 100644
index f7d5f3d4d..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelFinishedSpan.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.AbstractMap;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import io.opentelemetry.api.common.AttributeConsumer;
-import io.opentelemetry.api.common.AttributeKey;
-import io.opentelemetry.api.common.Attributes;
-import io.opentelemetry.sdk.trace.data.SpanData;
-
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.exporter.FinishedSpan;
-
-/**
- * OpenTelemetry implementation of a {@link FinishedSpan}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-class OtelFinishedSpan implements FinishedSpan {
-
- private final SpanData spanData;
-
- private final Map tags = new HashMap<>();
-
- OtelFinishedSpan(SpanData spanData) {
- this.spanData = spanData;
- }
-
- static FinishedSpan fromOtel(SpanData span) {
- return new OtelFinishedSpan(span);
- }
-
- @Override
- public String getName() {
- return this.spanData.getName();
- }
-
- @Override
- public long getStartTimestamp() {
- return this.spanData.getStartEpochNanos();
- }
-
- @Override
- public long getEndTimestamp() {
- return this.spanData.getEndEpochNanos();
- }
-
- @Override
- public Map getTags() {
- if (this.tags.isEmpty()) {
- this.spanData.getAttributes().forEach(new AttributeConsumer() {
- @Override
- public void accept(AttributeKey key, T value) {
- tags.put(key.getKey(), String.valueOf(value));
- }
- });
- }
- return this.tags;
- }
-
- @Override
- public Collection> getEvents() {
- return this.spanData.getEvents().stream()
- .map(e -> new AbstractMap.SimpleEntry<>(e.getEpochNanos(), e.getName())).collect(Collectors.toList());
- }
-
- @Override
- public String getSpanId() {
- return this.spanData.getSpanId();
- }
-
- @Override
- public String getParentId() {
- return this.spanData.getParentSpanId();
- }
-
- @Override
- public String getRemoteIp() {
- return getTags().get("net.peer.name");
- }
-
- @Override
- public int getRemotePort() {
- return Integer.valueOf(getTags().get("net.peer.port"));
- }
-
- @Override
- public String getTraceId() {
- return this.spanData.getTraceId();
- }
-
- @Override
- public Throwable getError() {
- Attributes attributes = this.spanData.getEvents().stream().filter(e -> e.getName().equals("exception"))
- .findFirst().map(e -> e.getAttributes()).orElse(null);
- if (attributes != null) {
- return new AssertingThrowable(attributes);
- }
- return null;
- }
-
- @Override
- public Span.Kind getKind() {
- if (this.spanData.getKind() == io.opentelemetry.api.trace.Span.Kind.INTERNAL) {
- return null;
- }
- return Span.Kind.valueOf(this.spanData.getKind().name());
- }
-
- @Override
- public String getRemoteServiceName() {
- return this.spanData.getAttributes().get(AttributeKey.stringKey("peer.service"));
- }
-
- @Override
- public String toString() {
- return "SpanDataToReportedSpan{" + "spanData=" + spanData + ", tags=" + tags + '}';
- }
-
- static class AssertingThrowable extends Throwable {
-
- /**
- * Attritbues set on the span.
- */
- public final Attributes attributes;
-
- AssertingThrowable(Attributes attributes) {
- super(attributes.get(AttributeKey.stringKey("exception.message")));
- this.attributes = attributes;
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelHttpClientHandler.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelHttpClientHandler.java
deleted file mode 100644
index cdf3f2f35..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelHttpClientHandler.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import io.opentelemetry.api.trace.Tracer;
-import io.opentelemetry.context.Scope;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-import io.opentelemetry.instrumentation.api.tracer.HttpClientTracer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.cloud.sleuth.SamplerFunction;
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.http.HttpClientHandler;
-import org.springframework.cloud.sleuth.http.HttpClientRequest;
-import org.springframework.cloud.sleuth.http.HttpClientResponse;
-import org.springframework.cloud.sleuth.http.HttpRequest;
-import org.springframework.cloud.sleuth.http.HttpRequestParser;
-import org.springframework.cloud.sleuth.http.HttpResponseParser;
-import org.springframework.lang.Nullable;
-import org.springframework.util.StringUtils;
-
-/**
- * OpenTelemetry implementation of a {@link HttpClientHandler}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class OtelHttpClientHandler extends HttpClientTracer
- implements HttpClientHandler {
-
- private static final Log log = LogFactory.getLog(OtelHttpClientHandler.class);
-
- private final HttpRequestParser httpClientRequestParser;
-
- private final HttpResponseParser httpClientResponseParser;
-
- private final SamplerFunction samplerFunction;
-
- public OtelHttpClientHandler(Tracer tracer, @Nullable HttpRequestParser httpClientRequestParser,
- @Nullable HttpResponseParser httpClientResponseParser, SamplerFunction samplerFunction) {
- super(tracer);
- this.httpClientRequestParser = httpClientRequestParser;
- this.httpClientResponseParser = httpClientResponseParser;
- this.samplerFunction = samplerFunction;
- }
-
- @Override
- public Span handleSend(HttpClientRequest request) {
- if (Boolean.FALSE.equals(this.samplerFunction.trySample(request))) {
- if (log.isDebugEnabled()) {
- log.debug("The sampler function filtered this request, will return an invalid span");
- }
- return OtelSpan.fromOtel(io.opentelemetry.api.trace.Span.getInvalid());
- }
- io.opentelemetry.api.trace.Span span = startSpan(request);
- return span(request, span);
- }
-
- @Override
- public Span handleSend(HttpClientRequest request, TraceContext parent) {
- if (Boolean.FALSE.equals(this.samplerFunction.trySample(request))) {
- if (log.isDebugEnabled()) {
- log.debug("Returning an invalid span since url [" + request.path() + "] is on a list of urls to skip");
- }
- return OtelSpan.fromOtel(io.opentelemetry.api.trace.Span.getInvalid());
- }
- io.opentelemetry.api.trace.Span span = parent != null ? ((OtelTraceContext) parent).span() : null;
- if (span == null) {
- return span(request, startSpan(request));
- }
- try (Scope scope = span.makeCurrent()) {
- io.opentelemetry.api.trace.Span withParent = startSpan(request);
- return span(request, withParent);
- }
- }
-
- private Span span(HttpClientRequest request, io.opentelemetry.api.trace.Span span) {
- try (Scope scope = startScope(span, request)) {
- if (span.isRecording()) {
- String remoteIp = request.remoteIp();
- if (StringUtils.hasText(remoteIp)) {
- span.setAttribute("net.peer.ip", remoteIp);
- }
- span.setAttribute("net.peer.port", request.remotePort());
- }
- return OtelSpan.fromOtel(span);
- }
- }
-
- @Override
- protected io.opentelemetry.api.trace.Span onRequest(io.opentelemetry.api.trace.Span span,
- HttpClientRequest httpClientRequest) {
- io.opentelemetry.api.trace.Span afterRequest = super.onRequest(span, httpClientRequest);
- if (this.httpClientRequestParser != null) {
- Span fromOtel = OtelSpan.fromOtel(afterRequest);
- this.httpClientRequestParser.parse(httpClientRequest, fromOtel.context(), fromOtel);
- }
- String path = httpClientRequest.path();
- if (path != null) {
- span.setAttribute("http.path", path);
- }
- return afterRequest;
- }
-
- @Override
- protected io.opentelemetry.api.trace.Span onResponse(io.opentelemetry.api.trace.Span span,
- HttpClientResponse httpClientResponse) {
- io.opentelemetry.api.trace.Span afterResponse = super.onResponse(span, httpClientResponse);
- if (this.httpClientResponseParser != null) {
- Span fromOtel = OtelSpan.fromOtel(afterResponse);
- this.httpClientResponseParser.parse(httpClientResponse, fromOtel.context(), fromOtel);
- }
- return afterResponse;
- }
-
- @Override
- public void handleReceive(HttpClientResponse response, Span span) {
- if (OtelSpan.toOtel(span).equals(io.opentelemetry.api.trace.Span.getInvalid())) {
- if (log.isDebugEnabled()) {
- log.debug("Not doing anything cause the span is invalid");
- }
- return;
- }
- io.opentelemetry.api.trace.Span otel = OtelSpan.toOtel(span);
- if (response.error() != null) {
- if (log.isDebugEnabled()) {
- log.debug("There was an error, will finish span [" + otel + "] exceptionally");
- }
- endExceptionally(otel, response, response.error());
- }
- else {
- if (log.isDebugEnabled()) {
- log.debug("There was no error, will finish span [" + otel + "] in a standard way");
- }
- end(otel, response);
- }
- }
-
- @Override
- protected String method(HttpClientRequest httpClientRequest) {
- return httpClientRequest.method();
- }
-
- @Override
- protected URI url(HttpClientRequest httpClientRequest) throws URISyntaxException {
- return URI.create(httpClientRequest.url());
- }
-
- @Override
- protected Integer status(HttpClientResponse httpClientResponse) {
- return httpClientResponse.statusCode();
- }
-
- @Override
- protected String requestHeader(HttpClientRequest httpClientRequest, String s) {
- return httpClientRequest.header(s);
- }
-
- @Override
- protected String responseHeader(HttpClientResponse httpClientResponse, String s) {
- return httpClientResponse.header(s);
- }
-
- @Override
- protected TextMapPropagator.Setter getSetter() {
- return HttpClientRequest::header;
- }
-
- @Override
- protected String getInstrumentationName() {
- return "org.springframework.cloud.sleuth";
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelHttpServerHandler.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelHttpServerHandler.java
deleted file mode 100644
index b29674431..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelHttpServerHandler.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.net.URI;
-import java.util.regex.Pattern;
-
-import io.opentelemetry.api.trace.Tracer;
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-import io.opentelemetry.instrumentation.api.tracer.HttpServerTracer;
-
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.http.HttpRequestParser;
-import org.springframework.cloud.sleuth.http.HttpResponseParser;
-import org.springframework.cloud.sleuth.http.HttpServerHandler;
-import org.springframework.cloud.sleuth.http.HttpServerRequest;
-import org.springframework.cloud.sleuth.http.HttpServerResponse;
-import org.springframework.cloud.sleuth.instrument.web.SkipPatternProvider;
-import org.springframework.util.StringUtils;
-
-/**
- * OpenTelemetry implementation of a {@link HttpServerHandler}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class OtelHttpServerHandler
- extends HttpServerTracer
- implements HttpServerHandler {
-
- private final HttpRequestParser httpServerRequestParser;
-
- private final HttpResponseParser httpServerResponseParser;
-
- private final Pattern pattern;
-
- public OtelHttpServerHandler(Tracer tracer, HttpRequestParser httpServerRequestParser,
- HttpResponseParser httpServerResponseParser, SkipPatternProvider skipPatternProvider) {
- super(tracer);
- this.httpServerRequestParser = httpServerRequestParser;
- this.httpServerResponseParser = httpServerResponseParser;
- this.pattern = skipPatternProvider.skipPattern();
- }
-
- @Override
- public Span handleReceive(HttpServerRequest request) {
- String url = request.path();
- boolean shouldSkip = !StringUtils.isEmpty(url) && this.pattern.matcher(url).matches();
- if (shouldSkip) {
- return OtelSpan.fromOtel(io.opentelemetry.api.trace.Span.getInvalid());
- }
- Context context = startSpan(request, request, request.method());
- return OtelSpan.fromOtel(io.opentelemetry.api.trace.Span.fromContext(context), context);
- }
-
- @Override
- public void handleSend(HttpServerResponse response, Span span) {
- Throwable throwable = response.error();
- io.opentelemetry.api.trace.Span otel = OtelSpan.toOtel(span);
- parseResponse(span, response);
- if (throwable == null) {
- end(otel, response);
- }
- else {
- endExceptionally(otel, throwable, response);
- }
- }
-
- private void parseResponse(Span span, HttpServerResponse response) {
- if (this.httpServerResponseParser != null) {
- this.httpServerResponseParser.parse(response, span.context(), span);
- }
- }
-
- @Override
- protected void onConnectionAndRequest(io.opentelemetry.api.trace.Span span, HttpServerRequest connection,
- HttpServerRequest request) {
- super.onConnectionAndRequest(span, connection, request);
- if (this.httpServerRequestParser != null) {
- Span fromOtel = OtelSpan.fromOtel(span);
- this.httpServerRequestParser.parse(request, fromOtel.context(), fromOtel);
- }
- }
-
- @Override
- protected void onRequest(io.opentelemetry.api.trace.Span span, HttpServerRequest request) {
- super.onRequest(span, request);
- String path = request.path();
- if (StringUtils.hasText(path)) {
- span.setAttribute("http.path", path);
- }
- }
-
- @Override
- public Context getServerContext(HttpServerRequest request) {
- Object context = request.getAttribute(CONTEXT_ATTRIBUTE);
- return context instanceof Context ? (Context) context : null;
- }
-
- @Override
- protected Integer peerPort(HttpServerRequest request) {
- return toUri(request).getPort();
- }
-
- @Override
- protected String peerHostIP(HttpServerRequest request) {
- return toUri(request).getHost();
- }
-
- @Override
- protected String flavor(HttpServerRequest request, HttpServerRequest request2) {
- return toUri(request).getScheme();
- }
-
- @Override
- protected TextMapPropagator.Getter getGetter() {
- return new TextMapPropagator.Getter() {
- @Override
- public Iterable keys(HttpServerRequest carrier) {
- return carrier.headerNames();
- }
-
- @Override
- public String get(HttpServerRequest carrier, String key) {
- return carrier.header(key);
- }
- };
- }
-
- @Override
- protected String url(HttpServerRequest request) {
- return request.url();
- }
-
- protected URI toUri(HttpServerRequest request) {
- return URI.create(request.url());
- }
-
- @Override
- protected String method(HttpServerRequest request) {
- return request.method();
- }
-
- @Override
- protected String requestHeader(HttpServerRequest request, String s) {
- return request.header(s);
- }
-
- @Override
- protected int responseStatus(HttpServerResponse httpServerResponse) {
- return httpServerResponse.statusCode();
- }
-
- @Override
- protected void attachServerContext(Context context, HttpServerRequest request) {
- request.setAttribute(CONTEXT_ATTRIBUTE, context);
- }
-
- @Override
- protected String getInstrumentationName() {
- return "org.springframework.cloud.sleuth";
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelOpenTelemetry.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelOpenTelemetry.java
deleted file mode 100644
index fdbf48ca9..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelOpenTelemetry.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.Objects;
-
-import io.opentelemetry.api.OpenTelemetry;
-import io.opentelemetry.api.metrics.MeterProvider;
-import io.opentelemetry.api.trace.TracerProvider;
-import io.opentelemetry.context.propagation.ContextPropagators;
-import io.opentelemetry.spi.metrics.MeterProviderFactory;
-import io.opentelemetry.spi.trace.TracerProviderFactory;
-
-/**
- * Sleuth implementation of a {@link OpenTelemetry}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class OtelOpenTelemetry implements OpenTelemetry {
-
- private final TracerProviderFactory tracerProviderFactory;
-
- private final MeterProviderFactory meterProviderFactory;
-
- private final TracerProvider tracerProvider;
-
- private final MeterProvider meterProvider;
-
- private final ContextPropagators contextPropagators;
-
- public OtelOpenTelemetry(TracerProviderFactory tracerProviderFactory, MeterProviderFactory meterProviderFactory,
- TracerProvider tracerProvider, MeterProvider meterProvider, ContextPropagators contextPropagators) {
- this.tracerProviderFactory = tracerProviderFactory;
- this.meterProviderFactory = meterProviderFactory;
- this.tracerProvider = tracerProvider;
- this.meterProvider = meterProvider;
- this.contextPropagators = contextPropagators;
- }
-
- @Override
- public TracerProvider getTracerProvider() {
- return this.tracerProvider;
- }
-
- @Override
- public MeterProvider getMeterProvider() {
- return this.meterProvider;
- }
-
- @Override
- public ContextPropagators getPropagators() {
- return this.contextPropagators;
- }
-
- @Override
- public io.opentelemetry.api.OpenTelemetryBuilder toBuilder() {
- return new Builder(this.meterProviderFactory, this.tracerProviderFactory);
- }
-
- static class Builder implements io.opentelemetry.api.OpenTelemetryBuilder {
-
- private ContextPropagators propagators;
-
- private TracerProvider tracerProvider;
-
- private MeterProvider meterProvider;
-
- private final MeterProviderFactory meterProviderFactory;
-
- private final TracerProviderFactory tracerProviderFactory;
-
- Builder(MeterProviderFactory meterProviderFactory, TracerProviderFactory tracerProviderFactory) {
- this.meterProviderFactory = meterProviderFactory;
- this.tracerProviderFactory = tracerProviderFactory;
- }
-
- public OtelOpenTelemetry.Builder setTracerProvider(TracerProvider tracerProvider) {
- Objects.requireNonNull(tracerProvider, "tracerProvider");
- this.tracerProvider = tracerProvider;
- return this;
- }
-
- public OtelOpenTelemetry.Builder setMeterProvider(MeterProvider meterProvider) {
- Objects.requireNonNull(meterProvider, "meterProvider");
- this.meterProvider = meterProvider;
- return this;
- }
-
- public OtelOpenTelemetry.Builder setPropagators(ContextPropagators propagators) {
- Objects.requireNonNull(propagators, "propagators");
- this.propagators = propagators;
- return this;
- }
-
- public OpenTelemetry build() {
- MeterProvider meterProvider = this.meterProvider;
- if (meterProvider == null) {
- meterProvider = this.meterProviderFactory.create();
- }
-
- TracerProvider tracerProvider = this.tracerProvider;
- if (tracerProvider == null) {
- tracerProvider = this.tracerProviderFactory.create();
- }
-
- return new OtelOpenTelemetry(tracerProviderFactory, meterProviderFactory, tracerProvider, meterProvider,
- this.propagators);
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelPropagator.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelPropagator.java
deleted file mode 100644
index 3d0be4b0a..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelPropagator.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.List;
-
-import io.opentelemetry.api.trace.Tracer;
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.propagation.ContextPropagators;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.propagation.Propagator;
-
-/**
- * OpenTelemetry implementation of a {@link Propagator}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class OtelPropagator implements Propagator {
-
- private final TextMapPropagator propagator;
-
- private final Tracer tracer;
-
- public OtelPropagator(ContextPropagators propagation, Tracer tracer) {
- this.propagator = propagation.getTextMapPropagator();
- this.tracer = tracer;
- }
-
- @Override
- public List fields() {
- return this.propagator.fields();
- }
-
- @Override
- public void inject(TraceContext traceContext, C carrier, Setter setter) {
- Context context = OtelTraceContext.toOtelContext(traceContext);
- this.propagator.inject(context, carrier, setter::set);
- }
-
- @Override
- public Span.Builder extract(C carrier, Getter getter) {
- Context extracted = this.propagator.extract(Context.current(), carrier, new TextMapPropagator.Getter() {
- @Override
- public Iterable keys(C carrier) {
- return fields();
- }
-
- @Override
- public String get(C carrier, String key) {
- return getter.get(carrier, key);
- }
- });
- io.opentelemetry.api.trace.Span span = io.opentelemetry.api.trace.Span.fromContextOrNull(extracted);
- if (span == null || span.equals(io.opentelemetry.api.trace.Span.getInvalid())) {
- return OtelSpanBuilder.fromOtel(tracer.spanBuilder(""));
- }
- return OtelSpanBuilder.fromOtel(this.tracer.spanBuilder("").setParent(extracted));
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelScopedSpan.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelScopedSpan.java
deleted file mode 100644
index 9d8022e2e..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelScopedSpan.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.context.Scope;
-
-import org.springframework.cloud.sleuth.ScopedSpan;
-import org.springframework.cloud.sleuth.TraceContext;
-
-/**
- * OpenTelemetry implementation of a {@link ScopedSpan}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-class OtelScopedSpan implements ScopedSpan {
-
- final Span span;
-
- final Scope scope;
-
- OtelScopedSpan(Span span, Scope scope) {
- this.span = span;
- this.scope = scope;
- }
-
- @Override
- public boolean isNoop() {
- return !this.span.isRecording();
- }
-
- @Override
- public TraceContext context() {
- return new OtelTraceContext(this.span);
- }
-
- @Override
- public ScopedSpan name(String name) {
- this.span.updateName(name);
- return this;
- }
-
- @Override
- public ScopedSpan tag(String key, String value) {
- this.span.setAttribute(key, value);
- return this;
- }
-
- @Override
- public ScopedSpan event(String value) {
- this.span.addEvent(value);
- return this;
- }
-
- @Override
- public ScopedSpan error(Throwable throwable) {
- this.span.recordException(throwable);
- return this;
- }
-
- @Override
- public void end() {
- this.scope.close();
- this.span.end();
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpan.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpan.java
deleted file mode 100644
index 3d1d600ff..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpan.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.time.Instant;
-import java.util.Objects;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
-
-import io.opentelemetry.api.common.AttributeKey;
-import io.opentelemetry.api.common.Attributes;
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.StatusCode;
-import io.opentelemetry.context.Context;
-
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.lang.Nullable;
-
-/**
- * OpenTelemetry implementation of a {@link Span}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-class OtelSpan implements Span {
-
- final io.opentelemetry.api.trace.Span delegate;
-
- private final AtomicReference context;
-
- OtelSpan(io.opentelemetry.api.trace.Span delegate) {
- this.delegate = delegate;
- if (delegate instanceof SpanFromSpanContext) {
- SpanFromSpanContext fromSpanContext = (SpanFromSpanContext) delegate;
- this.context = fromSpanContext.otelTraceContext.context;
- }
- else {
- this.context = new AtomicReference<>(Context.current());
- }
- }
-
- OtelSpan(io.opentelemetry.api.trace.Span delegate, Context context) {
- this.delegate = delegate;
- this.context = new AtomicReference<>(context);
- }
-
- static io.opentelemetry.api.trace.Span toOtel(Span span) {
- return ((OtelSpan) span).delegate;
- }
-
- static Span fromOtel(io.opentelemetry.api.trace.Span span) {
- return new OtelSpan(span);
- }
-
- static Span fromOtel(io.opentelemetry.api.trace.Span span, Context context) {
- return new OtelSpan(span, context);
- }
-
- @Override
- public boolean isNoop() {
- return !this.delegate.isRecording();
- }
-
- @Override
- public TraceContext context() {
- if (this.delegate == null) {
- return null;
- }
- return new OtelTraceContext(this.context, this.delegate.getSpanContext(), this.delegate);
- }
-
- @Override
- public Span start() {
- // they are already started via the builder
- return this;
- }
-
- @Override
- public Span name(String name) {
- this.delegate.updateName(name);
- return new OtelSpan(this.delegate);
- }
-
- @Override
- public Span event(String value) {
- this.delegate.addEvent(value);
- return new OtelSpan(this.delegate);
- }
-
- @Override
- public Span tag(String key, String value) {
- this.delegate.setAttribute(key, value);
- return new OtelSpan(this.delegate);
- }
-
- @Override
- public Span error(Throwable throwable) {
- this.delegate.recordException(throwable);
- return new OtelSpan(this.delegate);
- }
-
- @Override
- public void end() {
- this.delegate.end();
- }
-
- @Override
- public void abandon() {
- // TODO: [OTEL] doesn't seem to have this notion yet
- }
-
- @Override
- public String toString() {
- return this.delegate != null ? this.delegate.toString() : "null";
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- OtelSpan otelSpan = (OtelSpan) o;
- return Objects.equals(this.delegate, otelSpan.delegate);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(this.delegate);
- }
-
-}
-
-class SpanFromSpanContext implements io.opentelemetry.api.trace.Span {
-
- final io.opentelemetry.api.trace.Span span;
-
- final SpanContext newSpanContext;
-
- final OtelTraceContext otelTraceContext;
-
- SpanFromSpanContext(io.opentelemetry.api.trace.Span span, SpanContext newSpanContext,
- OtelTraceContext otelTraceContext) {
- this.span = span != null ? span : io.opentelemetry.api.trace.Span.wrap(newSpanContext);
- this.newSpanContext = newSpanContext;
- this.otelTraceContext = otelTraceContext;
- }
-
- @Override
- public io.opentelemetry.api.trace.Span setAttribute(String key, @Nullable String value) {
- return span.setAttribute(key, value);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span setAttribute(String key, long value) {
- return span.setAttribute(key, value);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span setAttribute(String key, double value) {
- return span.setAttribute(key, value);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span setAttribute(String key, boolean value) {
- return span.setAttribute(key, value);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span addEvent(String name) {
- return span.addEvent(name);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span addEvent(String name, long timestamp, TimeUnit unit) {
- return span.addEvent(name, timestamp, unit);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span addEvent(String name, Instant timestamp) {
- return span.addEvent(name, timestamp);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span addEvent(String name, Attributes attributes) {
- return span.addEvent(name, attributes);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span addEvent(String name, Attributes attributes, long timestamp, TimeUnit unit) {
- return span.addEvent(name, attributes, timestamp, unit);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span addEvent(String name, Attributes attributes, Instant timestamp) {
- return span.addEvent(name, attributes, timestamp);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span setStatus(StatusCode canonicalCode) {
- return span.setStatus(canonicalCode);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span setStatus(StatusCode canonicalCode, String description) {
- return span.setStatus(canonicalCode, description);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span setAttribute(AttributeKey key, int value) {
- return span.setAttribute(key, value);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span setAttribute(AttributeKey key, T value) {
- return span.setAttribute(key, value);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span recordException(Throwable exception) {
- return span.recordException(exception);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span recordException(Throwable exception, Attributes additionalAttributes) {
- return span.recordException(exception, additionalAttributes);
- }
-
- @Override
- public io.opentelemetry.api.trace.Span updateName(String name) {
- return span.updateName(name);
- }
-
- @Override
- public void end() {
- span.end();
- }
-
- @Override
- public void end(long timestamp, TimeUnit unit) {
- span.end(timestamp, unit);
- }
-
- @Override
- public void end(Instant timestamp) {
- span.end(timestamp);
- }
-
- @Override
- public SpanContext getSpanContext() {
- return newSpanContext;
- }
-
- @Override
- public boolean isRecording() {
- return span.isRecording();
- }
-
- @Override
- public Context storeInContext(Context context) {
- return span.storeInContext(context);
- }
-
- @Override
- public String toString() {
- return "SpanFromSpanContext{" + "span=" + span + ", newSpanContext=" + newSpanContext + '}';
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- SpanFromSpanContext that = (SpanFromSpanContext) o;
- return Objects.equals(span, that.span) && Objects.equals(this.newSpanContext, that.newSpanContext);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(this.span, this.newSpanContext);
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpanBuilder.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpanBuilder.java
deleted file mode 100644
index c53be3e71..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpanBuilder.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.util.StringUtils;
-
-/**
- * OpenTelemetry implementation of a {@link Span.Builder}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-class OtelSpanBuilder implements Span.Builder {
-
- private final io.opentelemetry.api.trace.SpanBuilder delegate;
-
- private final List annotations = new LinkedList<>();
-
- private String name;
-
- private Throwable error;
-
- OtelSpanBuilder(io.opentelemetry.api.trace.SpanBuilder delegate) {
- this.delegate = delegate;
- }
-
- static Span.Builder fromOtel(io.opentelemetry.api.trace.SpanBuilder builder) {
- return new OtelSpanBuilder(builder);
- }
-
- @Override
- public Span.Builder setParent(TraceContext context) {
- this.delegate.setParent(OtelTraceContext.toOtelContext(context));
- return this;
- }
-
- @Override
- public Span.Builder setNoParent() {
- this.delegate.setNoParent();
- return this;
- }
-
- @Override
- public Span.Builder name(String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public Span.Builder event(String value) {
- this.annotations.add(value);
- return this;
- }
-
- @Override
- public Span.Builder tag(String key, String value) {
- this.delegate.setAttribute(key, value);
- return this;
- }
-
- @Override
- public Span.Builder error(Throwable throwable) {
- this.error = throwable;
- return this;
- }
-
- @Override
- public Span.Builder kind(Span.Kind spanKind) {
- if (spanKind == null) {
- this.delegate.setSpanKind(io.opentelemetry.api.trace.Span.Kind.INTERNAL);
- return this;
- }
- io.opentelemetry.api.trace.Span.Kind kind = io.opentelemetry.api.trace.Span.Kind.INTERNAL;
- switch (spanKind) {
- case CLIENT:
- kind = io.opentelemetry.api.trace.Span.Kind.CLIENT;
- break;
- case SERVER:
- kind = io.opentelemetry.api.trace.Span.Kind.SERVER;
- break;
- case PRODUCER:
- kind = io.opentelemetry.api.trace.Span.Kind.PRODUCER;
- break;
- case CONSUMER:
- kind = io.opentelemetry.api.trace.Span.Kind.CONSUMER;
- break;
- }
- this.delegate.setSpanKind(kind);
- return this;
- }
-
- @Override
- public Span.Builder remoteServiceName(String remoteServiceName) {
- this.delegate.setAttribute("peer.service", remoteServiceName);
- return this;
- }
-
- @Override
- public Span start() {
- io.opentelemetry.api.trace.Span span = this.delegate.startSpan();
- if (StringUtils.hasText(this.name)) {
- span.updateName(this.name);
- }
- if (this.error != null) {
- span.recordException(error);
- }
- this.annotations.forEach(span::addEvent);
- return OtelSpan.fromOtel(span);
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpanCustomizer.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpanCustomizer.java
deleted file mode 100644
index 4a6a12d24..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelSpanCustomizer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.api.trace.Span;
-
-import org.springframework.cloud.sleuth.SpanCustomizer;
-
-/**
- * OpenTelemetry implementation of a {@link SpanCustomizer}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class OtelSpanCustomizer implements SpanCustomizer {
-
- @Override
- public SpanCustomizer name(String name) {
- currentSpan().updateName(name);
- return this;
- }
-
- private Span currentSpan() {
- return Span.current();
- }
-
- @Override
- public SpanCustomizer tag(String key, String value) {
- currentSpan().setAttribute(key, value);
- return this;
- }
-
- @Override
- public SpanCustomizer event(String value) {
- currentSpan().addEvent(value);
- return this;
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelTraceContext.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelTraceContext.java
deleted file mode 100644
index 5eb998b5c..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelTraceContext.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.Objects;
-import java.util.concurrent.atomic.AtomicReference;
-
-import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.context.Context;
-import io.opentelemetry.sdk.trace.ReadableSpan;
-
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.lang.Nullable;
-
-/**
- * OpenTelemetry implementation of a {@link TraceContext}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-class OtelTraceContext implements TraceContext {
-
- final AtomicReference context;
-
- final SpanContext delegate;
-
- final Span span;
-
- OtelTraceContext(Context context, SpanContext delegate, @Nullable Span span) {
- this(new AtomicReference<>(context), delegate, span);
- }
-
- OtelTraceContext(AtomicReference context, SpanContext delegate, @Nullable Span span) {
- this.context = context;
- this.delegate = delegate;
- this.span = span;
- }
-
- OtelTraceContext(SpanContext delegate, @Nullable Span span) {
- this.context = new AtomicReference<>(Context.current());
- this.delegate = delegate;
- this.span = span;
- }
-
- OtelTraceContext(Span span) {
- this(Context.current(), span.getSpanContext(), span);
- }
-
- OtelTraceContext(SpanFromSpanContext span) {
- this(span.otelTraceContext.context.get(), span.getSpanContext(), span);
- }
-
- static TraceContext fromOtel(SpanContext traceContext) {
- return new OtelTraceContext(traceContext, null);
- }
-
- static Context toOtelContext(TraceContext context) {
- if (context instanceof OtelTraceContext) {
- Span span = ((OtelTraceContext) context).span;
- if (span != null) {
- return span.storeInContext(Context.current());
- }
- }
- return Context.current();
- }
-
- @Override
- public String traceId() {
- return this.delegate.getTraceIdAsHexString();
- }
-
- @Override
- @Nullable
- public String parentId() {
- if (this.span instanceof ReadableSpan) {
- ReadableSpan readableSpan = (ReadableSpan) this.span;
- return readableSpan.toSpanData().getParentSpanId();
- }
- return null;
- }
-
- @Override
- public String spanId() {
- return this.delegate.getSpanIdAsHexString();
- }
-
- @Override
- public Boolean sampled() {
- return this.delegate.isSampled();
- }
-
- @Override
- public String toString() {
- return this.delegate != null ? this.delegate.toString() : "null";
- }
-
- Span span() {
- return this.span;
- }
-
- Context context() {
- return this.context.get();
- }
-
- void updateContext(Context context) {
- this.context.set(context);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- OtelTraceContext context = (OtelTraceContext) o;
- return Objects.equals(this.delegate, context.delegate);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(this.delegate);
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelTracer.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelTracer.java
deleted file mode 100644
index 168247d58..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelTracer.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.Map;
-
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.context.Scope;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.cloud.sleuth.BaggageInScope;
-import org.springframework.cloud.sleuth.BaggageManager;
-import org.springframework.cloud.sleuth.ScopedSpan;
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.SpanCustomizer;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.Tracer;
-import org.springframework.context.ApplicationEventPublisher;
-
-/**
- * OpenTelemetry implementation of a {@link Tracer}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class OtelTracer implements Tracer {
-
- private final io.opentelemetry.api.trace.Tracer tracer;
-
- private final BaggageManager otelBaggageManager;
-
- private final ApplicationEventPublisher publisher;
-
- public OtelTracer(io.opentelemetry.api.trace.Tracer tracer, ApplicationEventPublisher publisher,
- BaggageManager otelBaggageManager) {
- this.tracer = tracer;
- this.publisher = publisher;
- this.otelBaggageManager = otelBaggageManager;
- }
-
- @Override
- public Span nextSpan(Span parent) {
- if (parent == null) {
- return nextSpan();
- }
- return OtelSpan.fromOtel(
- this.tracer.spanBuilder("").setParent(OtelTraceContext.toOtelContext(parent.context())).startSpan());
- }
-
- @Override
- public SpanInScope withSpan(Span span) {
- io.opentelemetry.api.trace.Span delegate = delegate(span);
- return new OtelSpanInScope((OtelSpan) span, delegate);
- }
-
- protected io.opentelemetry.api.trace.Span delegate(Span span) {
- if (span == null) {
- this.publisher.publishEvent(new OtelCurrentTraceContext.ScopeClosed(this));
- return io.opentelemetry.api.trace.Span.getInvalid();
- }
- return ((OtelSpan) span).delegate;
- }
-
- @Override
- public SpanCustomizer currentSpanCustomizer() {
- return new OtelSpanCustomizer();
- }
-
- @Override
- public Span currentSpan() {
- io.opentelemetry.api.trace.Span currentSpan = io.opentelemetry.api.trace.Span.current();
- if (currentSpan == null || currentSpan.equals(io.opentelemetry.api.trace.Span.getInvalid())) {
- return null;
- }
- return new OtelSpan(currentSpan);
- }
-
- @Override
- public Span nextSpan() {
- return new OtelSpan(this.tracer.spanBuilder("").startSpan());
- }
-
- @Override
- public ScopedSpan startScopedSpan(String name) {
- io.opentelemetry.api.trace.Span span = this.tracer.spanBuilder(name).startSpan();
- return new OtelScopedSpan(span, span.makeCurrent());
- }
-
- @Override
- public Span.Builder spanBuilder() {
- return new OtelSpanBuilder(this.tracer.spanBuilder(""));
- }
-
- @Override
- public Map getAllBaggage() {
- return this.otelBaggageManager.getAllBaggage();
- }
-
- @Override
- public BaggageInScope getBaggage(String name) {
- return this.otelBaggageManager.getBaggage(name);
- }
-
- @Override
- public BaggageInScope getBaggage(TraceContext traceContext, String name) {
- return this.otelBaggageManager.getBaggage(traceContext, name);
- }
-
- @Override
- public BaggageInScope createBaggage(String name) {
- return this.otelBaggageManager.createBaggage(name);
- }
-
- @Override
- public BaggageInScope createBaggage(String name, String value) {
- return this.otelBaggageManager.createBaggage(name, value);
- }
-
-}
-
-class OtelSpanInScope implements Tracer.SpanInScope {
-
- private static final Log log = LogFactory.getLog(OtelSpanInScope.class);
-
- final Scope delegate;
-
- final OtelSpan sleuthSpan;
-
- final io.opentelemetry.api.trace.Span otelSpan;
-
- final SpanContext spanContext;
-
- OtelSpanInScope(OtelSpan sleuthSpan, io.opentelemetry.api.trace.Span otelSpan) {
- this.sleuthSpan = sleuthSpan;
- this.otelSpan = otelSpan;
- this.delegate = otelSpan.makeCurrent();
- this.spanContext = otelSpan.getSpanContext();
- }
-
- @Override
- public void close() {
- if (log.isTraceEnabled()) {
- log.trace("Will close scope for trace context [" + this.spanContext + "]");
- }
- this.delegate.close();
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/SkipPatternSampler.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/SkipPatternSampler.java
deleted file mode 100644
index 0dd11d0d4..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/SkipPatternSampler.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.regex.Pattern;
-
-import org.springframework.cloud.sleuth.SamplerFunction;
-import org.springframework.cloud.sleuth.http.HttpRequest;
-
-/**
- * Decides if sampling should take place for the given request.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class SkipPatternSampler implements SamplerFunction {
-
- private final Pattern pattern;
-
- public SkipPatternSampler(Pattern pattern) {
- this.pattern = pattern;
- }
-
- @Override
- public final Boolean trySample(HttpRequest request) {
- String url = request.path();
- boolean shouldSkip = this.pattern.matcher(url).matches();
- if (shouldSkip) {
- return false;
- }
- return null;
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/Slf4jBaggageSpanProcessor.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/Slf4jBaggageSpanProcessor.java
deleted file mode 100644
index f939bda03..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/Slf4jBaggageSpanProcessor.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.List;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-
-import io.opentelemetry.context.Context;
-import io.opentelemetry.sdk.common.CompletableResultCode;
-import io.opentelemetry.sdk.trace.ReadWriteSpan;
-import io.opentelemetry.sdk.trace.ReadableSpan;
-import io.opentelemetry.sdk.trace.SpanProcessor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.slf4j.MDC;
-
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.cloud.sleuth.BaggageManager;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
-
-public class Slf4jBaggageSpanProcessor implements SpanProcessor, ApplicationListener {
-
- private static final Log log = LogFactory.getLog(Slf4jBaggageSpanProcessor.class);
-
- private final List correlationFields;
-
- private final BeanFactory beanFactory;
-
- private BaggageManager baggageManager;
-
- public Slf4jBaggageSpanProcessor(List correlationFields, BeanFactory beanFactory) {
- this.correlationFields = correlationFields;
- this.beanFactory = beanFactory;
- }
-
- private BaggageManager baggageManager() {
- if (this.baggageManager == null) {
- this.baggageManager = this.beanFactory.getBean(BaggageManager.class);
- }
- return this.baggageManager;
- }
-
- @Override
- public void onStart(Context parent, ReadWriteSpan span) {
- onStart();
- }
-
- private void onStart() {
- flushAllBaggageEntries();
- }
-
- @Override
- public boolean isStartRequired() {
- return true;
- }
-
- @Override
- public void onEnd(ReadableSpan span) {
- removeAllBaggageEntries();
- }
-
- @Override
- public boolean isEndRequired() {
- return true;
- }
-
- @Override
- public CompletableResultCode shutdown() {
- onEnd(null);
- return CompletableResultCode.ofSuccess();
- }
-
- @Override
- public CompletableResultCode forceFlush() {
- flushAllBaggageEntries();
- return CompletableResultCode.ofSuccess();
- }
-
- private void flushAllBaggageEntries() {
- onEachCorrelatedBaggageEntry(e -> MDC.put(e.getKey(), e.getValue()));
- }
-
- private void onEachCorrelatedBaggageEntry(Consumer> consumer) {
- List correlationFields = lowerCaseCorrelationFields();
- baggageManager().getAllBaggage().entrySet().stream()
- .filter(e -> correlationFields.contains(e.getKey().toLowerCase())).forEach(consumer);
- }
-
- private void removeAllBaggageEntries() {
- onEachCorrelatedBaggageEntry(e -> MDC.remove(e.getKey()));
- }
-
- private List lowerCaseCorrelationFields() {
- return this.correlationFields.stream().map(String::toLowerCase).collect(Collectors.toList());
- }
-
- private void onBaggageChanged(OtelBaggageInScope.BaggageChanged event) {
- if (log.isTraceEnabled()) {
- log.trace("Got baggage changed event [" + event + "]");
- }
- if (lowerCaseCorrelationFields().contains(event.name.toLowerCase())) {
- if (log.isTraceEnabled()) {
- log.trace("Correlation enabled and baggage with name [" + event.name
- + "] is present on the list of correlated fields");
- }
- MDC.put(event.name, event.value);
- }
- }
-
- private void onScopeChanged(OtelCurrentTraceContext.ScopeChanged event) {
- if (log.isTraceEnabled()) {
- log.trace("Got scope changed event [" + event + "]");
- }
- if (event.span != null) {
- onStart();
- }
- }
-
- private void onScopeClosed(OtelCurrentTraceContext.ScopeClosed event) {
- if (log.isTraceEnabled()) {
- log.trace("Got scope closed event [" + event + "]");
- }
- onEnd(null);
- }
-
- @Override
- public void onApplicationEvent(ApplicationEvent event) {
- if (event instanceof OtelBaggageInScope.BaggageChanged) {
- onBaggageChanged((OtelBaggageInScope.BaggageChanged) event);
- }
- else if (event instanceof OtelCurrentTraceContext.ScopeChanged) {
- onScopeChanged((OtelCurrentTraceContext.ScopeChanged) event);
- }
- else if (event instanceof OtelCurrentTraceContext.ScopeClosed) {
- onScopeClosed((OtelCurrentTraceContext.ScopeClosed) event);
- }
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/Slf4jSpanProcessor.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/Slf4jSpanProcessor.java
deleted file mode 100644
index 6804f2f8b..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/Slf4jSpanProcessor.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.context.Context;
-import io.opentelemetry.sdk.common.CompletableResultCode;
-import io.opentelemetry.sdk.trace.ReadWriteSpan;
-import io.opentelemetry.sdk.trace.ReadableSpan;
-import io.opentelemetry.sdk.trace.SpanProcessor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.slf4j.MDC;
-
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
-
-public class Slf4jSpanProcessor implements SpanProcessor, ApplicationListener {
-
- private static final Log log = LogFactory.getLog(Slf4jSpanProcessor.class);
-
- @Override
- public void onStart(Context parent, ReadWriteSpan span) {
- onStart(span.getSpanContext().getTraceIdAsHexString(), span.getSpanContext().getSpanIdAsHexString());
- }
-
- private void onStart(String traceId, String spanId) {
- MDC.put("traceId", traceId);
- MDC.put("spanId", spanId);
- }
-
- @Override
- public boolean isStartRequired() {
- return true;
- }
-
- @Override
- public void onEnd(ReadableSpan span) {
- MDC.remove("traceId");
- MDC.remove("spanId");
- }
-
- @Override
- public boolean isEndRequired() {
- return true;
- }
-
- @Override
- public CompletableResultCode shutdown() {
- onEnd(null);
- return CompletableResultCode.ofSuccess();
- }
-
- @Override
- public CompletableResultCode forceFlush() {
- return CompletableResultCode.ofSuccess();
- }
-
- private void onScopeChanged(OtelCurrentTraceContext.ScopeChanged event) {
- if (log.isTraceEnabled()) {
- log.trace("Got scope changed event [" + event + "]");
- }
- if (event.span != null) {
- onStart(event.span.getSpanContext().getTraceIdAsHexString(),
- event.span.getSpanContext().getSpanIdAsHexString());
- }
- }
-
- private void onScopeClosed(OtelCurrentTraceContext.ScopeClosed event) {
- if (log.isTraceEnabled()) {
- log.trace("Got scope closed event [" + event + "]");
- }
- onEnd(null);
- }
-
- @Override
- public void onApplicationEvent(ApplicationEvent event) {
- if (event instanceof OtelCurrentTraceContext.ScopeChanged) {
- onScopeChanged((OtelCurrentTraceContext.ScopeChanged) event);
- }
- else if (event instanceof OtelCurrentTraceContext.ScopeClosed) {
- onScopeClosed((OtelCurrentTraceContext.ScopeClosed) event);
- }
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/SpanExporterCustomizer.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/SpanExporterCustomizer.java
deleted file mode 100644
index 4fe89a103..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/bridge/SpanExporterCustomizer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-
-/**
- * Allows customization of a {@link SpanExporter}.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public interface SpanExporterCustomizer {
-
- /**
- * Customizes a span exporter.
- * @param spanExporter to customize
- * @return customized span exporter
- */
- default SpanExporter customize(SpanExporter spanExporter) {
- return spanExporter;
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/BaggageTextMapPropagator.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/BaggageTextMapPropagator.java
deleted file mode 100644
index eac7bdf32..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/BaggageTextMapPropagator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.propagation;
-
-import java.util.AbstractMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import io.opentelemetry.api.baggage.Baggage;
-import io.opentelemetry.api.baggage.BaggageBuilder;
-import io.opentelemetry.api.baggage.EntryMetadata;
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.cloud.sleuth.BaggageManager;
-
-/**
- * {@link TextMapPropagator} that adds Sleuth compatible baggage entries (name of the
- * field means an HTTP header entry).
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class BaggageTextMapPropagator implements TextMapPropagator {
-
- private static final Log log = LogFactory.getLog(BaggageTextMapPropagator.class);
-
- private final List remoteFields;
-
- private final BaggageManager baggageManager;
-
- public BaggageTextMapPropagator(List remoteFields, BaggageManager baggageManager) {
- this.remoteFields = remoteFields;
- this.baggageManager = baggageManager;
- }
-
- @Override
- public List fields() {
- return this.remoteFields;
- }
-
- @Override
- public void inject(Context context, C c, Setter setter) {
- List> baggageEntries = applicableBaggageEntries(c);
- baggageEntries.forEach(e -> setter.set(c, e.getKey(), e.getValue()));
- }
-
- private List> applicableBaggageEntries(C c) {
- Map allBaggage = this.baggageManager.getAllBaggage();
- List lowerCaseKeys = this.remoteFields.stream().map(String::toLowerCase).collect(Collectors.toList());
- return allBaggage.entrySet().stream().filter(e -> lowerCaseKeys.contains(e.getKey().toLowerCase()))
- .collect(Collectors.toList());
- }
-
- @Override
- public Context extract(Context context, C c, Getter getter) {
- Map baggageEntries = this.remoteFields.stream()
- .map(s -> new AbstractMap.SimpleEntry<>(s, getter.get(c, s))).filter(e -> e.getValue() != null)
- .collect(Collectors.toMap((e) -> e.getKey(), (e) -> e.getValue()));
- BaggageBuilder builder = Baggage.builder().setParent(context);
- // TODO: [OTEL] magic string
- baggageEntries.forEach((key, value) -> builder.put(key, value, EntryMetadata.create("propagation=unlimited")));
- Baggage baggage = builder.build();
- Context withBaggage = context.with(baggage);
- if (log.isDebugEnabled()) {
- log.debug("Will propagate new baggage context for entries " + baggageEntries);
- }
- return withBaggage;
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/CompositeTextMapPropagator.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/CompositeTextMapPropagator.java
deleted file mode 100644
index 8cef65b00..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/CompositeTextMapPropagator.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.propagation;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import io.opentelemetry.api.baggage.propagation.W3CBaggagePropagator;
-import io.opentelemetry.api.trace.Span;
-import io.opentelemetry.api.trace.propagation.HttpTraceContext;
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-import io.opentelemetry.extension.trace.propagation.AwsXRayPropagator;
-import io.opentelemetry.extension.trace.propagation.B3Propagator;
-import io.opentelemetry.extension.trace.propagation.JaegerPropagator;
-import io.opentelemetry.extension.trace.propagation.OtTracerPropagator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.lang.Nullable;
-import org.springframework.util.ClassUtils;
-
-/**
- * {@link TextMapPropagator} implementation that can read / write from multiple
- * {@link TextMapPropagator} implementations.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public class CompositeTextMapPropagator implements TextMapPropagator {
-
- private static final Log log = LogFactory.getLog(CompositeTextMapPropagator.class);
-
- private final Map mapping = new HashMap<>();
-
- private final List types;
-
- public CompositeTextMapPropagator(BeanFactory beanFactory, List types) {
- this.types = types;
- if (isOnClasspath("io.opentelemetry.extension.trace.propagation.AwsXRayPropagator")) {
- this.mapping.put(PropagationType.AWS, beanFactory.getBeanProvider(AwsXRayPropagator.class)
- .getIfAvailable(AwsXRayPropagator::getInstance));
- }
- if (isOnClasspath("io.opentelemetry.extension.trace.propagation.B3Propagator")) {
- this.mapping.put(PropagationType.B3,
- beanFactory.getBeanProvider(B3Propagator.class).getIfAvailable(B3Propagator::getInstance));
- }
- if (isOnClasspath("io.opentelemetry.extension.trace.propagation.JaegerPropagator")) {
- this.mapping.put(PropagationType.JAEGER,
- beanFactory.getBeanProvider(JaegerPropagator.class).getIfAvailable(JaegerPropagator::getInstance));
- }
- if (isOnClasspath("io.opentelemetry.extension.trace.propagation.OtTracerPropagator")) {
- this.mapping.put(PropagationType.OT_TRACER, beanFactory.getBeanProvider(OtTracerPropagator.class)
- .getIfAvailable(OtTracerPropagator::getInstance));
- }
- this.mapping.put(PropagationType.W3C, new MultiTextMapPropagator(
- Arrays.asList(HttpTraceContext.getInstance(), W3CBaggagePropagator.getInstance())));
- this.mapping.put(PropagationType.CUSTOM, NoopTextMapPropagator.INSTANCE);
- log.info("Registered the following context propagation types " + this.mapping.keySet());
- }
-
- private boolean isOnClasspath(String clazz) {
- return ClassUtils.isPresent(clazz, null);
- }
-
- @Override
- public List fields() {
- return this.types.stream().map(key -> this.mapping.getOrDefault(key, NoopTextMapPropagator.INSTANCE))
- .flatMap(p -> p.fields().stream()).collect(Collectors.toList());
- }
-
- @Override
- public void inject(Context context, C carrier, Setter setter) {
- this.types.stream().map(key -> this.mapping.getOrDefault(key, NoopTextMapPropagator.INSTANCE))
- .forEach(p -> p.inject(context, carrier, setter));
- }
-
- @Override
- public Context extract(Context context, C carrier, Getter getter) {
- for (PropagationType type : this.types) {
- TextMapPropagator propagator = this.mapping.get(type);
- if (propagator == null || propagator == NoopTextMapPropagator.INSTANCE) {
- continue;
- }
- Context extractedContext = propagator.extract(context, carrier, getter);
- Span span = Span.fromContextOrNull(extractedContext);
- if (span != null) {
- return extractedContext;
- }
- }
- return context;
- }
-
- private static final class NoopTextMapPropagator implements TextMapPropagator {
-
- private static final NoopTextMapPropagator INSTANCE = new NoopTextMapPropagator();
-
- @Override
- public List fields() {
- return Collections.emptyList();
- }
-
- @Override
- public void inject(Context context, C carrier, Setter setter) {
- }
-
- @Override
- public Context extract(Context context, C carrier, Getter getter) {
- return context;
- }
-
- }
-
- // Taken from OTel
- private static final class MultiTextMapPropagator implements TextMapPropagator {
-
- private final TextMapPropagator[] textPropagators;
-
- private final List allFields;
-
- private MultiTextMapPropagator(List textPropagators) {
- this.textPropagators = new TextMapPropagator[textPropagators.size()];
- textPropagators.toArray(this.textPropagators);
- this.allFields = Collections.unmodifiableList(getAllFields(this.textPropagators));
- }
-
- private static List getAllFields(TextMapPropagator[] textPropagators) {
- Set fields = new LinkedHashSet<>();
- for (int i = 0; i < textPropagators.length; i++) {
- fields.addAll(textPropagators[i].fields());
- }
-
- return new ArrayList<>(fields);
- }
-
- @Override
- public List fields() {
- return allFields;
- }
-
- @Override
- public void inject(Context context, @Nullable C carrier, Setter setter) {
- for (int i = 0; i < textPropagators.length; i++) {
- textPropagators[i].inject(context, carrier, setter);
- }
- }
-
- @Override
- public Context extract(Context context, @Nullable C carrier, Getter getter) {
- for (int i = 0; i < textPropagators.length; i++) {
- context = textPropagators[i].extract(context, carrier, getter);
- }
- return context;
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/PropagationType.java b/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/PropagationType.java
deleted file mode 100644
index be3e67b17..000000000
--- a/spring-cloud-sleuth-otel/src/main/java/org/springframework/cloud/sleuth/otel/propagation/PropagationType.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.propagation;
-
-/*
- * Supported propagation types.
- *
- * @author Marcin Grzejszczak
- * @since 3.0.0
- */
-public enum PropagationType {
-
- /**
- * AWS propagation type.
- */
- AWS,
-
- /**
- * B3 propagation type.
- */
- B3,
-
- /**
- * Jaeger propagation type.
- */
- JAEGER,
-
- /**
- * Lightstep propagation type.
- */
- OT_TRACER,
-
- /**
- * W3C propagation type.
- */
- W3C,
-
- /**
- * Custom propagation type.
- */
- CUSTOM
-
-}
diff --git a/spring-cloud-sleuth-otel/src/test/java/org/springframework/cloud/sleuth/ArchitectureTests.java b/spring-cloud-sleuth-otel/src/test/java/org/springframework/cloud/sleuth/ArchitectureTests.java
deleted file mode 100644
index 434c404af..000000000
--- a/spring-cloud-sleuth-otel/src/test/java/org/springframework/cloud/sleuth/ArchitectureTests.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth;
-
-import com.tngtech.archunit.core.importer.ImportOption;
-import com.tngtech.archunit.core.importer.Location;
-import com.tngtech.archunit.junit.AnalyzeClasses;
-import com.tngtech.archunit.junit.ArchTest;
-import com.tngtech.archunit.lang.ArchRule;
-
-import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
-
-@AnalyzeClasses(packagesOf = ArchitectureTests.class, importOptions = ArchitectureTests.ProductionCode.class)
-public class ArchitectureTests {
-
- @ArchTest
- public static final ArchRule should_not_contain_any_spring_configuration_reference_in_module = noClasses().should()
- .dependOnClassesThat().resideInAnyPackage("..org.springframework.boot.context.properties..",
- "..org.springframework.context.annotation..");
-
- static class ProductionCode implements ImportOption {
-
- @Override
- public boolean includes(Location location) {
- return Predefined.DO_NOT_INCLUDE_TESTS.includes(location)
- && Predefined.DO_NOT_INCLUDE_JARS.includes(location);
- }
-
- }
-
-}
diff --git a/spring-cloud-sleuth-otel/src/test/resources/META-INF/application.yml b/spring-cloud-sleuth-otel/src/test/resources/META-INF/application.yml
deleted file mode 100644
index 7d3456888..000000000
--- a/spring-cloud-sleuth-otel/src/test/resources/META-INF/application.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
-
-spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
diff --git a/spring-cloud-sleuth-zipkin/pom.xml b/spring-cloud-sleuth-zipkin/pom.xml
index 485f7f2db..50f2b0f54 100644
--- a/spring-cloud-sleuth-zipkin/pom.xml
+++ b/spring-cloud-sleuth-zipkin/pom.xml
@@ -40,18 +40,6 @@
org.springframework.cloud
spring-cloud-sleuth-brave
-
- true
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
- true
-
-
- io.opentelemetry
- opentelemetry-exporter-zipkin
true
diff --git a/tests/common/pom.xml b/tests/common/pom.xml
index 8a3a872de..875408915 100644
--- a/tests/common/pom.xml
+++ b/tests/common/pom.xml
@@ -129,26 +129,11 @@
brave-tests
true
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
- true
-
-
- io.opentelemetry
- opentelemetry-extension-trace-propagators
- true
-
org.springframework.cloud
spring-cloud-sleuth-zipkin
true
-
- io.opentelemetry
- opentelemetry-exporter-zipkin
- true
-
io.zipkin.zipkin2
zipkin
diff --git a/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestSpanHandler.java b/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestSpanHandler.java
deleted file mode 100644
index a15ea44d6..000000000
--- a/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestSpanHandler.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import io.opentelemetry.context.Context;
-import io.opentelemetry.sdk.common.CompletableResultCode;
-import io.opentelemetry.sdk.trace.ReadWriteSpan;
-import io.opentelemetry.sdk.trace.ReadableSpan;
-import io.opentelemetry.sdk.trace.SpanProcessor;
-import io.opentelemetry.sdk.trace.data.SpanData;
-import io.opentelemetry.sdk.trace.export.SpanExporter;
-
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.exporter.FinishedSpan;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.cloud.sleuth.otel.bridge.OtelAccessor;
-import org.springframework.cloud.sleuth.test.TestSpanHandler;
-
-public class OtelTestSpanHandler implements TestSpanHandler, SpanProcessor, SpanExporter {
-
- private final ArrayListSpanProcessor spanProcessor;
-
- public OtelTestSpanHandler(ArrayListSpanProcessor spanProcessor) {
- this.spanProcessor = spanProcessor;
- }
-
- @Override
- public List reportedSpans() {
- return spanProcessor.spans().stream().map(OtelAccessor::finishedSpan).collect(Collectors.toList());
- }
-
- @Override
- public FinishedSpan takeLocalSpan() {
- return OtelAccessor.finishedSpan(spanProcessor.takeLocalSpan());
- }
-
- @Override
- public void clear() {
- spanProcessor.clear();
- }
-
- @Override
- public FinishedSpan takeRemoteSpan(Span.Kind kind) {
- return reportedSpans().stream().filter(s -> s.getKind().name().equals(kind.name())).findFirst()
- .orElseThrow(() -> new AssertionError("No span with kind [" + kind.name() + "] found."));
- }
-
- @Override
- public FinishedSpan takeRemoteSpanWithError(Span.Kind kind) {
- return reportedSpans().stream().filter(s -> s.getKind().name().equals(kind.name()) && s.getError() != null)
- .findFirst()
- .orElseThrow(() -> new AssertionError("No span with kind [" + kind.name() + "] and error found."));
- }
-
- @Override
- public FinishedSpan get(int index) {
- return reportedSpans().get(index);
- }
-
- @Override
- public Iterator iterator() {
- return reportedSpans().iterator();
- }
-
- @Override
- public void onStart(Context parentContext, ReadWriteSpan span) {
- spanProcessor.onStart(parentContext, span);
- }
-
- @Override
- public boolean isStartRequired() {
- return spanProcessor.isStartRequired();
- }
-
- @Override
- public void onEnd(ReadableSpan span) {
- spanProcessor.onEnd(span);
- }
-
- @Override
- public boolean isEndRequired() {
- return spanProcessor.isEndRequired();
- }
-
- @Override
- public CompletableResultCode export(Collection spans) {
- return spanProcessor.export(spans);
- }
-
- @Override
- public CompletableResultCode flush() {
- return spanProcessor.flush();
- }
-
- @Override
- public CompletableResultCode shutdown() {
- return spanProcessor.shutdown();
- }
-
- @Override
- public CompletableResultCode forceFlush() {
- return spanProcessor.forceFlush();
- }
-
- @Override
- public String toString() {
- return "OtelTestSpanHandler{" + "spanProcessor=" + this.spanProcessor + '}';
- }
-
-}
diff --git a/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestTracing.java b/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestTracing.java
deleted file mode 100644
index 2f909a591..000000000
--- a/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestTracing.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel;
-
-import java.io.Closeable;
-import java.util.regex.Pattern;
-
-import io.opentelemetry.api.OpenTelemetry;
-import io.opentelemetry.api.metrics.MeterProvider;
-import io.opentelemetry.api.trace.TracerProvider;
-import io.opentelemetry.context.propagation.ContextPropagators;
-import io.opentelemetry.context.propagation.DefaultContextPropagators;
-import io.opentelemetry.extension.trace.propagation.B3Propagator;
-import io.opentelemetry.sdk.trace.TracerSdkProvider;
-import io.opentelemetry.sdk.trace.config.TraceConfig;
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-import io.opentelemetry.sdk.trace.spi.TracerProviderFactorySdk;
-import io.opentelemetry.spi.metrics.MeterProviderFactory;
-import io.opentelemetry.spi.trace.TracerProviderFactory;
-
-import org.springframework.cloud.sleuth.CurrentTraceContext;
-import org.springframework.cloud.sleuth.SamplerFunction;
-import org.springframework.cloud.sleuth.Tracer;
-import org.springframework.cloud.sleuth.autoconfig.SleuthBaggageProperties;
-import org.springframework.cloud.sleuth.http.HttpClientHandler;
-import org.springframework.cloud.sleuth.http.HttpRequestParser;
-import org.springframework.cloud.sleuth.http.HttpServerHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.cloud.sleuth.otel.bridge.OtelAccessor;
-import org.springframework.cloud.sleuth.otel.bridge.OtelOpenTelemetry;
-import org.springframework.cloud.sleuth.propagation.Propagator;
-import org.springframework.cloud.sleuth.test.TestSpanHandler;
-import org.springframework.cloud.sleuth.test.TestTracingAssertions;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-import org.springframework.cloud.sleuth.test.TestTracingAwareSupplier;
-import org.springframework.cloud.sleuth.test.TracerAware;
-import org.springframework.context.ApplicationEventPublisher;
-
-public class OtelTestTracing implements TracerAware, TestTracingAware, TestTracingAwareSupplier, Closeable {
-
- ArrayListSpanProcessor spanProcessor = new ArrayListSpanProcessor();
-
- ContextPropagators contextPropagators = contextPropagators();
-
- OpenTelemetry openTelemetry = otel();
-
- ContextPropagators defaultContextPropagators = OpenTelemetry.getGlobalPropagators();
-
- Sampler sampler = Sampler.alwaysOn();
-
- HttpRequestParser clientRequestParser;
-
- io.opentelemetry.api.trace.Tracer tracer = otelTracer();
-
- CurrentTraceContext currentTraceContext = OtelAccessor.currentTraceContext(publisher());
-
- io.opentelemetry.api.trace.Tracer otelTracer() {
- TracerSdkProvider provider = TracerSdkProvider.builder().build();
- provider.addSpanProcessor(this.spanProcessor);
- provider.updateActiveTraceConfig(TraceConfig.getDefault().toBuilder().setSampler(this.sampler).build());
- return provider.get("org.springframework.cloud.sleuth");
- }
-
- protected ContextPropagators contextPropagators() {
- return DefaultContextPropagators.builder()
- .addTextMapPropagator(B3Propagator.builder().injectMultipleHeaders().build()).build();
- }
-
- OpenTelemetry otel() {
- TracerProviderFactory providerFactory = otelTracerProviderFactory();
- MeterProviderFactory meterProviderFactory = otelMeterProviderFactory();
- OtelOpenTelemetry otelOpenTelemetry = new OtelOpenTelemetry(providerFactory, meterProviderFactory,
- otelTracerProvider(providerFactory), otelMeterProvider(meterProviderFactory), this.contextPropagators);
- OpenTelemetry.set(otelOpenTelemetry);
- OpenTelemetry.setGlobalPropagators(contextPropagators);
- return otelOpenTelemetry;
- }
-
- TracerProviderFactory otelTracerProviderFactory() {
- return new TracerProviderFactorySdk();
- }
-
- TracerProvider otelTracerProvider(TracerProviderFactory tracerProviderFactory) {
- return tracerProviderFactory.create();
- }
-
- MeterProviderFactory otelMeterProviderFactory() {
- return OpenTelemetry::getGlobalMeterProvider;
- }
-
- MeterProvider otelMeterProvider(MeterProviderFactory meterProviderFactory) {
- return meterProviderFactory.create();
- }
-
- private void reset() {
- this.contextPropagators = contextPropagators();
- this.tracer = otelTracer();
- this.currentTraceContext = OtelAccessor.currentTraceContext(publisher());
- }
-
- @Override
- public TracerAware sampler(TraceSampler sampler) {
- this.sampler = sampler == TraceSampler.ON ? Sampler.alwaysOn() : Sampler.alwaysOff();
- return this;
- }
-
- @Override
- public TracerAware tracing() {
- return this;
- }
-
- @Override
- public TestSpanHandler handler() {
- return new OtelTestSpanHandler(this.spanProcessor);
- }
-
- @Override
- public TestTracingAssertions assertions() {
- return new OtelTestTracingAssertions();
- }
-
- @Override
- public void close() {
- this.spanProcessor.clear();
- OpenTelemetry.setGlobalPropagators(this.defaultContextPropagators);
- this.sampler = Sampler.alwaysOn();
- }
-
- @Override
- public TestTracingAware tracerTest() {
- return this;
- }
-
- @Override
- public Tracer tracer() {
- reset();
- return OtelAccessor.tracer(this.tracer, this.currentTraceContext, new SleuthBaggageProperties(), publisher());
- }
-
- @Override
- public CurrentTraceContext currentTraceContext() {
- reset();
- return OtelAccessor.currentTraceContext(publisher());
- }
-
- @Override
- public Propagator propagator() {
- reset();
- return OtelAccessor.propagator(this.contextPropagators, this.tracer);
- }
-
- @Override
- public HttpServerHandler httpServerHandler() {
- reset();
- return OtelAccessor.httpServerHandler(this.tracer, null, null, () -> Pattern.compile(""));
- }
-
- @Override
- public TracerAware clientRequestParser(HttpRequestParser httpRequestParser) {
- this.clientRequestParser = httpRequestParser;
- return this;
- }
-
- @Override
- public HttpClientHandler httpClientHandler() {
- reset();
- return OtelAccessor.httpClientHandler(this.tracer, this.clientRequestParser, null,
- SamplerFunction.alwaysSample());
- }
-
- ApplicationEventPublisher publisher() {
- return event -> {
-
- };
- }
-
-}
diff --git a/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestTracingAssertions.java b/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestTracingAssertions.java
deleted file mode 100644
index a031ed16c..000000000
--- a/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/OtelTestTracingAssertions.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel;
-
-import org.assertj.core.api.BDDAssertions;
-
-import org.springframework.cloud.sleuth.exporter.FinishedSpan;
-import org.springframework.cloud.sleuth.test.TestTracingAssertions;
-
-public class OtelTestTracingAssertions implements TestTracingAssertions {
-
- @Override
- public void assertThatNoParentPresent(FinishedSpan finishedSpan) {
- BDDAssertions.then(Long.valueOf(finishedSpan.getParentId())).isEqualTo(0L);
- }
-
- @Override
- public String or128Bit(String id) {
- return "0000000000000000" + id;
- }
-
-}
diff --git a/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelAccessor.java b/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelAccessor.java
deleted file mode 100644
index 1f9565d92..000000000
--- a/tests/common/src/main/java/org/springframework/cloud/sleuth/otel/bridge/OtelAccessor.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.context.propagation.ContextPropagators;
-import io.opentelemetry.sdk.trace.data.SpanData;
-
-import org.springframework.cloud.sleuth.CurrentTraceContext;
-import org.springframework.cloud.sleuth.SamplerFunction;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.Tracer;
-import org.springframework.cloud.sleuth.autoconfig.SleuthBaggageProperties;
-import org.springframework.cloud.sleuth.exporter.FinishedSpan;
-import org.springframework.cloud.sleuth.http.HttpClientHandler;
-import org.springframework.cloud.sleuth.http.HttpRequest;
-import org.springframework.cloud.sleuth.http.HttpRequestParser;
-import org.springframework.cloud.sleuth.http.HttpResponseParser;
-import org.springframework.cloud.sleuth.http.HttpServerHandler;
-import org.springframework.cloud.sleuth.instrument.web.SkipPatternProvider;
-import org.springframework.cloud.sleuth.propagation.Propagator;
-import org.springframework.context.ApplicationEventPublisher;
-import org.springframework.lang.Nullable;
-
-public final class OtelAccessor {
-
- private OtelAccessor() {
- throw new IllegalStateException("Can't instantiate a utility class");
- }
-
- public static Tracer tracer(io.opentelemetry.api.trace.Tracer tracer, CurrentTraceContext currentTraceContext,
- SleuthBaggageProperties sleuthBaggageProperties, ApplicationEventPublisher publisher) {
- return new OtelTracer(tracer, publisher, new OtelBaggageManager(currentTraceContext,
- sleuthBaggageProperties.getRemoteFields(), sleuthBaggageProperties.getTagFields(), publisher));
- }
-
- public static CurrentTraceContext currentTraceContext(ApplicationEventPublisher publisher) {
- return new OtelCurrentTraceContext(publisher);
- }
-
- public static CurrentTraceContext currentTraceContext() {
- return currentTraceContext(event -> {
- });
- }
-
- public static TraceContext traceContext(SpanContext spanContext) {
- return OtelTraceContext.fromOtel(spanContext);
- }
-
- public static Propagator propagator(ContextPropagators propagators, io.opentelemetry.api.trace.Tracer tracer) {
- return new OtelPropagator(propagators, tracer);
- }
-
- public static HttpClientHandler httpClientHandler(io.opentelemetry.api.trace.Tracer tracer,
- @Nullable HttpRequestParser httpClientRequestParser, @Nullable HttpResponseParser httpClientResponseParser,
- SamplerFunction samplerFunction) {
- return new OtelHttpClientHandler(tracer, httpClientRequestParser, httpClientResponseParser, samplerFunction);
- }
-
- public static HttpServerHandler httpServerHandler(io.opentelemetry.api.trace.Tracer tracer,
- HttpRequestParser httpServerRequestParser, HttpResponseParser httpServerResponseParser,
- SkipPatternProvider skipPatternProvider) {
- return new OtelHttpServerHandler(tracer, httpServerRequestParser, httpServerResponseParser,
- skipPatternProvider);
- }
-
- public static FinishedSpan finishedSpan(SpanData spanData) {
- return new OtelFinishedSpan(spanData);
- }
-
-}
diff --git a/tests/otel/pom.xml b/tests/otel/pom.xml
deleted file mode 100644
index f80e5537a..000000000
--- a/tests/otel/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-otel-tests
- pom
- Spring Cloud Sleuth Otel Tests
- Spring Cloud Sleuth Otel Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- spring-cloud-sleuth-instrumentation-annotation-tests
- spring-cloud-sleuth-instrumentation-async-tests
- spring-cloud-sleuth-instrumentation-baggage-tests
- spring-cloud-sleuth-instrumentation-circuitbreaker-tests
- spring-cloud-sleuth-instrumentation-feign-tests
- spring-cloud-sleuth-instrumentation-gateway-tests
- spring-cloud-sleuth-instrumentation-messaging-tests
- spring-cloud-sleuth-instrumentation-mvc-tests
- spring-cloud-sleuth-instrumentation-quartz-tests
- spring-cloud-sleuth-instrumentation-reactor-tests
- spring-cloud-sleuth-instrumentation-rxjava-tests
- spring-cloud-sleuth-instrumentation-scheduling-tests
- spring-cloud-sleuth-instrumentation-webflux-tests
- spring-cloud-sleuth-zipkin-tests
-
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/pom.xml
deleted file mode 100644
index f4acd850e..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/pom.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-annotation-otel-tests
- jar
- Spring Cloud Sleuth Otel Annotation Instrumentation Tests
- Spring Cloud Sleuth Otel Annotation Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.boot
- spring-boot-starter-webflux
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/NullSpanTagAnnotationHandlerTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/NullSpanTagAnnotationHandlerTests.java
deleted file mode 100644
index 5dbe5cecf..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/NullSpanTagAnnotationHandlerTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.annotation;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest
-@ContextConfiguration(classes = NullSpanTagAnnotationHandlerTests.Config.class)
-public class NullSpanTagAnnotationHandlerTests
- extends org.springframework.cloud.sleuth.instrument.annotation.NullSpanTagAnnotationHandlerTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectFluxTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectFluxTests.java
deleted file mode 100644
index 99d388f39..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectFluxTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.annotation;
-
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.SpanId;
-import io.opentelemetry.api.trace.TraceFlags;
-import io.opentelemetry.api.trace.TraceId;
-import io.opentelemetry.api.trace.TraceState;
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.cloud.sleuth.otel.bridge.OtelAccessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest
-@ContextConfiguration(classes = SleuthSpanCreatorAspectFluxTests.Config.class)
-public class SleuthSpanCreatorAspectFluxTests
- extends org.springframework.cloud.sleuth.instrument.annotation.SleuthSpanCreatorAspectFluxTests {
-
- @Override
- public TraceContext traceContext() {
- return OtelAccessor.traceContext(SpanContext.create(TraceId.fromLongs(1L, 0L), SpanId.fromLong(2L),
- TraceFlags.getSampled(), TraceState.builder().build()));
- }
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectMonoTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectMonoTests.java
deleted file mode 100644
index a8d73ab20..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectMonoTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.annotation;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest
-@ContextConfiguration(classes = SleuthSpanCreatorAspectMonoTests.Config.class)
-public class SleuthSpanCreatorAspectMonoTests
- extends org.springframework.cloud.sleuth.instrument.annotation.SleuthSpanCreatorAspectMonoTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectNegativeTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectNegativeTests.java
deleted file mode 100644
index 041abf12d..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectNegativeTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.annotation;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest
-@ContextConfiguration(classes = SleuthSpanCreatorAspectNegativeTests.Config.class)
-public class SleuthSpanCreatorAspectNegativeTests
- extends org.springframework.cloud.sleuth.instrument.annotation.SleuthSpanCreatorAspectNegativeTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectTests.java
deleted file mode 100644
index 8776ed9b7..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorAspectTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.annotation;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest
-@ContextConfiguration(classes = SleuthSpanCreatorAspectTests.Config.class)
-public class SleuthSpanCreatorAspectTests
- extends org.springframework.cloud.sleuth.instrument.annotation.SleuthSpanCreatorAspectTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorCircularDependencyTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorCircularDependencyTests.java
deleted file mode 100644
index 5cbf98283..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SleuthSpanCreatorCircularDependencyTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.annotation;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest
-@ContextConfiguration(classes = SleuthSpanCreatorCircularDependencyTests.Config.class)
-public class SleuthSpanCreatorCircularDependencyTests
- extends org.springframework.cloud.sleuth.instrument.annotation.SleuthSpanCreatorCircularDependencyTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SpanTagAnnotationHandlerTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SpanTagAnnotationHandlerTests.java
deleted file mode 100644
index 149e789fc..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/java/org/springframework/cloud/sleuth/otel/annotation/SpanTagAnnotationHandlerTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.annotation;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest
-@ContextConfiguration(classes = SpanTagAnnotationHandlerTests.Config.class)
-public class SpanTagAnnotationHandlerTests
- extends org.springframework.cloud.sleuth.instrument.annotation.SpanTagAnnotationHandlerTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/resources/application.yml
deleted file mode 100644
index caf171df7..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-annotation-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
-
-spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/pom.xml
deleted file mode 100644
index a48ee3627..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/pom.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-async-otel-tests
- jar
- Spring Cloud Sleuth Otel Async Instrumentation Tests
- Spring Cloud Sleuth Otel Async Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- ${project.groupId}
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/AsyncDisabledTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/AsyncDisabledTests.java
deleted file mode 100644
index 2d144519e..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/AsyncDisabledTests.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.async;
-
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
-public class AsyncDisabledTests extends org.springframework.cloud.sleuth.instrument.async.AsyncDisabledTests {
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/LazyTraceThreadPoolTaskSchedulerTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/LazyTraceThreadPoolTaskSchedulerTests.java
deleted file mode 100644
index 9fbb9a0d8..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/LazyTraceThreadPoolTaskSchedulerTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.async;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class LazyTraceThreadPoolTaskSchedulerTests
- extends org.springframework.cloud.sleuth.instrument.async.LazyTraceThreadPoolTaskSchedulerTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceAsyncAspectTest.java b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceAsyncAspectTest.java
deleted file mode 100644
index 5441f3ef4..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceAsyncAspectTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.async;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-/**
- * @author Marcin Grzejszczak
- */
-public class TraceAsyncAspectTest extends org.springframework.cloud.sleuth.instrument.async.TraceAsyncAspectTest {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceAsyncListenableTaskExecutorTest.java b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceAsyncListenableTaskExecutorTest.java
deleted file mode 100644
index ccdd9904f..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceAsyncListenableTaskExecutorTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.async;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-/**
- * @author Marcin Grzejszczak
- */
-public class TraceAsyncListenableTaskExecutorTest
- extends org.springframework.cloud.sleuth.instrument.async.TraceAsyncListenableTaskExecutorTest {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceCallableTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceCallableTests.java
deleted file mode 100644
index 37bc6ac43..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceCallableTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.async;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class TraceCallableTests extends org.springframework.cloud.sleuth.instrument.async.TraceCallableTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceRunnableTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceRunnableTests.java
deleted file mode 100644
index e489b0e85..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceRunnableTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.async;
-
-import org.assertj.core.api.BDDAssertions;
-
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class TraceRunnableTests extends org.springframework.cloud.sleuth.instrument.async.TraceRunnableTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
- @Override
- protected void assertThatThereIsNoParentId(Span secondSpan) {
- BDDAssertions.then(secondSpan.context().parentId()).as("saved span as remnant of first span")
- .isEqualTo(io.opentelemetry.api.trace.Span.getInvalid().getSpanContext().getSpanIdAsHexString());
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceableExecutorServiceTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceableExecutorServiceTests.java
deleted file mode 100644
index 501a4ec76..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceableExecutorServiceTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.async;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class TraceableExecutorServiceTests
- extends org.springframework.cloud.sleuth.instrument.async.TraceableExecutorServiceTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceableScheduledExecutorServiceTest.java b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceableScheduledExecutorServiceTest.java
deleted file mode 100644
index 91d833350..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/async/TraceableScheduledExecutorServiceTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.async;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-/**
- * @author Marcin Grzejszczak
- */
-public class TraceableScheduledExecutorServiceTest
- extends org.springframework.cloud.sleuth.instrument.async.TraceableScheduledExecutorServiceTest {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/resources/application.yml
deleted file mode 100644
index 9ed06adbb..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-async-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/pom.xml
deleted file mode 100644
index 21316e837..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/pom.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-baggage-otel-tests
- jar
- Spring Cloud Sleuth Otel Baggage Instrumentation Tests
- Spring Cloud Sleuth Otel Baggage Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.integration
- spring-integration-core
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
- com.squareup.okhttp3
- mockwebserver
-
-
- com.squareup.okhttp3
- okhttp
-
- 4.8.0
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/BaggageEntryTagSpanHandlerTest.java b/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/BaggageEntryTagSpanHandlerTest.java
deleted file mode 100644
index 262601436..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/BaggageEntryTagSpanHandlerTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-/**
- * @author Taras Danylchuk
- */
-@SpringBootTest(// WebEnvironment.NONE will not read a Yaml profile
- webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = BaggageEntryTagSpanHandlerTest.Config.class)
-public class BaggageEntryTagSpanHandlerTest
- extends org.springframework.cloud.sleuth.baggage.BaggageEntryTagSpanHandlerTest {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/MultipleHopsIntegrationTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/MultipleHopsIntegrationTests.java
deleted file mode 100644
index 90abc146d..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/MultipleHopsIntegrationTests.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.util.Queue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
-import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
-import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.baggage.multiple.DemoApplication;
-import org.springframework.cloud.sleuth.exporter.FinishedSpan;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.TestPropertySource;
-
-import static java.util.Arrays.asList;
-import static org.assertj.core.api.BDDAssertions.then;
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
-
-@SpringBootTest(webEnvironment = RANDOM_PORT)
-@ContextConfiguration(classes = MultipleHopsIntegrationTests.Config.class)
-@TestPropertySource(properties = "spring.sleuth.otel.propagation.sleuth-baggage.enabled=true")
-public class MultipleHopsIntegrationTests
- extends org.springframework.cloud.sleuth.baggage.multiple.MultipleHopsIntegrationTests {
-
- @Autowired
- MyBaggageChangedListener myBaggageChangedListener;
-
- @Autowired
- DemoApplication demoApplication;
-
- // TODO: Why do we have empty names here
- @Override
- protected void assertSpanNames() {
- then(this.spans).extracting(FinishedSpan::getName).containsAll(asList("HTTP GET", "handle", "send"));
- }
-
- @Override
- protected void assertBaggage(Span initialSpan) {
- then(this.myBaggageChangedListener.baggageChanged).as("All have request ID")
- .filteredOn(b -> b.name.equals(REQUEST_ID))
- .allMatch(event -> "f4308d05-2228-4468-80f6-92a8377ba193".equals(event.value));
- then(this.demoApplication.getBaggageValue()).isEqualTo("FO");
- }
-
- @Configuration(proxyBeanMethods = false)
- @EnableAutoConfiguration(
- exclude = { MongoAutoConfiguration.class, QuartzAutoConfiguration.class, JmxAutoConfiguration.class })
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- @Bean
- MyBaggageChangedListener myBaggageChangedListener() {
- return new MyBaggageChangedListener();
- }
-
- }
-
-}
-
-class MyBaggageChangedListener implements ApplicationListener {
-
- Queue baggageChanged = new LinkedBlockingQueue<>();
-
- @Override
- public void onApplicationEvent(OtelBaggageInScope.BaggageChanged event) {
- this.baggageChanged.add(event);
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/W3CBaggageTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/W3CBaggageTests.java
deleted file mode 100644
index 64aba3a78..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/W3CBaggageTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-/**
- * @author Taras Danylchuk
- */
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
-@ContextConfiguration(classes = W3CBaggageTests.Config.class)
-public class W3CBaggageTests extends org.springframework.cloud.sleuth.baggage.W3CBaggageTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/resources/application.yml
deleted file mode 100644
index caf171df7..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-baggage-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
-
-spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/pom.xml
deleted file mode 100644
index da8a92749..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/pom.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-circuitbreaker-otel-tests
- jar
- Spring Cloud Sleuth Otel Circuitbreaker Instrumentation Tests
- Spring Cloud Sleuth Otel Circuitbreaker Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.cloud
- spring-cloud-starter-circuitbreaker-resilience4j
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/CircuitBreakerIntegrationTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/CircuitBreakerIntegrationTests.java
deleted file mode 100644
index 811e1b29b..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/CircuitBreakerIntegrationTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.api.common.AttributeKey;
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-import org.assertj.core.api.BDDAssertions;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.exporter.FinishedSpan;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest
-@ContextConfiguration(classes = CircuitBreakerIntegrationTests.Config.class)
-public class CircuitBreakerIntegrationTests
- extends org.springframework.cloud.sleuth.instrument.circuitbreaker.CircuitBreakerIntegrationTests {
-
- @Override
- public void assertException(FinishedSpan finishedSpan) {
- OtelFinishedSpan.AssertingThrowable throwable = (OtelFinishedSpan.AssertingThrowable) finishedSpan.getError();
- String msg = throwable.attributes.get(AttributeKey.stringKey("exception.message"));
- BDDAssertions.then(msg).contains("boom");
- }
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/CircuitBreakerTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/CircuitBreakerTests.java
deleted file mode 100644
index f5a8e2b5f..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/CircuitBreakerTests.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.api.common.AttributeKey;
-import org.assertj.core.api.BDDAssertions;
-
-import org.springframework.cloud.sleuth.exporter.FinishedSpan;
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class CircuitBreakerTests
- extends org.springframework.cloud.sleuth.instrument.circuitbreaker.CircuitBreakerTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
- @Override
- public void additionalAssertions(FinishedSpan finishedSpan) {
- OtelFinishedSpan.AssertingThrowable throwable = (OtelFinishedSpan.AssertingThrowable) finishedSpan.getError();
- String msg = throwable.attributes.get(AttributeKey.stringKey("exception.message"));
- BDDAssertions.then(msg).contains("boom2");
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/resources/application.yml
deleted file mode 100644
index caf171df7..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-circuitbreaker-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
-
-spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/pom.xml
deleted file mode 100644
index 0b0926f50..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-feign-otel-tests
- jar
- Spring Cloud Sleuth Otel Feign Instrumentation Tests
- Spring Cloud Sleuth Otel Feign Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- ${project.groupId}
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- com.squareup.okhttp3
- mockwebserver
-
-
- com.squareup.okhttp3
- okhttp
-
- 4.8.0
- compile
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.cloud
- spring-cloud-starter-openfeign
-
-
- org.springframework.cloud
- spring-cloud-starter-loadbalancer
-
-
- org.springframework.cloud
- spring-cloud-starter-circuitbreaker-resilience4j
-
-
- io.github.openfeign
- feign-okhttp
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/FeignRetriesTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/FeignRetriesTests.java
deleted file mode 100644
index 1f778e06d..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/FeignRetriesTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import java.io.IOException;
-
-import io.opentelemetry.api.common.AttributeKey;
-import org.assertj.core.api.BDDAssertions;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class FeignRetriesTests extends org.springframework.cloud.sleuth.instrument.web.client.feign.FeignRetriesTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
- @Override
- public void assertException() {
- OtelFinishedSpan.AssertingThrowable throwable = (OtelFinishedSpan.AssertingThrowable) this.tracerTest()
- .handler().reportedSpans().get(0).getError();
- String type = throwable.attributes.get(AttributeKey.stringKey("exception.type"));
- BDDAssertions.then(type).contains(IOException.class.getSimpleName());
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/TraceFeignAspectTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/TraceFeignAspectTests.java
deleted file mode 100644
index 76fc84c8e..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/TraceFeignAspectTests.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-/**
- * @author Marcin Grzejszczak
- */
-public class TraceFeignAspectTests
- extends org.springframework.cloud.sleuth.instrument.web.client.feign.TraceFeignAspectTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/TracingFeignClientTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/TracingFeignClientTests.java
deleted file mode 100644
index 252c4d501..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/java/org/springframework/cloud/sleuth/otel/bridge/TracingFeignClientTests.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.bridge;
-
-import io.opentelemetry.api.common.AttributeKey;
-import org.assertj.core.api.BDDAssertions;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class TracingFeignClientTests
- extends org.springframework.cloud.sleuth.instrument.web.client.feign.TracingFeignClientTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
- @Override
- public void assertException(RuntimeException error) {
- OtelFinishedSpan.AssertingThrowable throwable = (OtelFinishedSpan.AssertingThrowable) this.tracerTest()
- .handler().reportedSpans().get(0).getError();
- String message = throwable.attributes.get(AttributeKey.stringKey("exception.message"));
- BDDAssertions.then(message).isEqualTo(error.getMessage());
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/resources/application.yml
deleted file mode 100644
index b3b1e54dd..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-feign-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/pom.xml
deleted file mode 100644
index f7d6ece65..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-gateway-otel-tests
- jar
- Spring Cloud Sleuth Otel Gateway Instrumentation Tests
- Spring Cloud Sleuth Otel Gateway Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.cloud
- spring-cloud-starter-gateway
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRequestHttpHeadersFilterTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRequestHttpHeadersFilterTests.java
deleted file mode 100644
index e1d49e5f7..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRequestHttpHeadersFilterTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class TraceRequestHttpHeadersFilterTests
- extends org.springframework.cloud.sleuth.instrument.web.client.TraceRequestHttpHeadersFilterTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceResponseHttpHeadersFilterTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceResponseHttpHeadersFilterTests.java
deleted file mode 100644
index 781236868..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceResponseHttpHeadersFilterTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class TraceResponseHttpHeadersFilterTests
- extends org.springframework.cloud.sleuth.instrument.web.client.TraceResponseHttpHeadersFilterTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/resources/application.yml
deleted file mode 100644
index caf171df7..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-gateway-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
-
-spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.data b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.data
deleted file mode 100644
index 3ba33e62e..000000000
Binary files a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.data and /dev/null differ
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.redo b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.redo
deleted file mode 100644
index 14e640f13..000000000
Binary files a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/db.redo and /dev/null differ
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/lock b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/lock
deleted file mode 100644
index 60d95e53f..000000000
Binary files a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/activemq-data/localhost/KahaDB/lock and /dev/null differ
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/pom.xml
deleted file mode 100644
index 60fcd4525..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/pom.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-messaging-otel-tests
- jar
- Spring Cloud Sleuth Otel Messaging Instrumentation Tests
- Spring Cloud Sleuth Otel Messaging Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.cloud
- spring-cloud-stream
- jar
-
-
- org.springframework.cloud
- spring-cloud-stream
- test-jar
- test-binder
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.junit.vintage
- junit-vintage-engine
-
-
-
-
- org.awaitility
- awaitility
-
-
-
- org.springframework.integration
- spring-integration-core
-
-
- org.springframework.boot
- spring-boot-starter-websocket
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/messaging/TraceWebSocketAutoConfigurationTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/messaging/TraceWebSocketAutoConfigurationTests.java
deleted file mode 100644
index a6fb037c2..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/messaging/TraceWebSocketAutoConfigurationTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.messaging;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-/**
- * @author Marcin Grzejszczak
- */
-@SpringBootTest
-@ContextConfiguration(classes = TraceWebSocketAutoConfigurationTests.Config.class)
-public class TraceWebSocketAutoConfigurationTests
- extends org.springframework.cloud.sleuth.instrument.messaging.TraceWebSocketAutoConfigurationTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/messaging/TracingChannelInterceptorTest.java b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/messaging/TracingChannelInterceptorTest.java
deleted file mode 100644
index c40c05d44..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/messaging/TracingChannelInterceptorTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.messaging;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Nullable;
-
-import io.opentelemetry.context.Context;
-import io.opentelemetry.context.propagation.ContextPropagators;
-import io.opentelemetry.context.propagation.DefaultContextPropagators;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-import io.opentelemetry.extension.trace.propagation.B3Propagator;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class TracingChannelInterceptorTest
- extends org.springframework.cloud.sleuth.instrument.messaging.TracingChannelInterceptorTest {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing() {
- @Override
- protected ContextPropagators contextPropagators() {
- return DefaultContextPropagators.builder().addTextMapPropagator(b3()).build();
- }
-
- TextMapPropagator b3() {
- return new TextMapPropagator() {
- @Override
- public List fields() {
- List fields = new ArrayList<>(B3Propagator.getInstance().fields());
- fields.add("b3");
- return fields;
- }
-
- @Override
- public void inject(Context context, @Nullable C c, Setter setter) {
- B3Propagator.getInstance().inject(context, c, setter);
- }
-
- @Override
- public Context extract(Context context, @Nullable C c, Getter getter) {
- return B3Propagator.getInstance().extract(context, c, getter);
- }
- };
- }
- };
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/util/SpanUtil.java b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/util/SpanUtil.java
deleted file mode 100644
index 8e8c2f4ff..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/util/SpanUtil.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.util;
-
-/**
- * @author Marcin Grzejszczak
- * @since
- */
-public final class SpanUtil {
-
- static final char[] HEX_DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
-
- private SpanUtil() {
- throw new IllegalStateException("Can't instantiate a utility class");
- }
-
- // Represents given long id as 16-character lower-hex string
- public static String idToHex(long id) {
- char[] data = new char[16];
- writeHexLong(data, 0, id);
- return new String(data);
- }
-
- // Inspired by {@code okio.Buffer.writeLong}
- static void writeHexLong(char[] data, int pos, long v) {
- writeHexByte(data, pos + 0, (byte) ((v >>> 56L) & 0xff));
- writeHexByte(data, pos + 2, (byte) ((v >>> 48L) & 0xff));
- writeHexByte(data, pos + 4, (byte) ((v >>> 40L) & 0xff));
- writeHexByte(data, pos + 6, (byte) ((v >>> 32L) & 0xff));
- writeHexByte(data, pos + 8, (byte) ((v >>> 24L) & 0xff));
- writeHexByte(data, pos + 10, (byte) ((v >>> 16L) & 0xff));
- writeHexByte(data, pos + 12, (byte) ((v >>> 8L) & 0xff));
- writeHexByte(data, pos + 14, (byte) (v & 0xff));
- }
-
- static void writeHexByte(char[] data, int pos, byte b) {
- data[pos + 0] = HEX_DIGITS[(b >> 4) & 0xf];
- data[pos + 1] = HEX_DIGITS[b & 0xf];
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/application.yml
deleted file mode 100644
index 9ed06adbb..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/beans/applicationContext.xml b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/beans/applicationContext.xml
deleted file mode 100644
index d7cdd3d19..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/beans/applicationContext.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/logback.xml b/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/logback.xml
deleted file mode 100644
index a7061973e..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-messaging-tests/src/test/resources/logback.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/pom.xml
deleted file mode 100644
index 6c6395642..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/pom.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-mvc-otel-tests
- jar
- Spring Cloud Sleuth Otel Mvc Instrumentation Tests
- Spring Cloud Sleuth Otel Mvc Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- ${project.groupId}
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.apache.httpcomponents
- httpclient
-
-
- com.squareup.okhttp3
- mockwebserver
-
-
- com.squareup.okhttp3
- okhttp
-
- 4.8.0
- compile
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/HttpServerParserTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/HttpServerParserTests.java
deleted file mode 100644
index e74adcfdb..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/HttpServerParserTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = HttpServerParserTests.Config.class)
-public class HttpServerParserTests extends org.springframework.cloud.sleuth.instrument.web.HttpServerParserTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/IgnoreAutoConfiguredSkipPatternsIntegrationTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/IgnoreAutoConfiguredSkipPatternsIntegrationTests.java
deleted file mode 100644
index 09b5ee625..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/IgnoreAutoConfiguredSkipPatternsIntegrationTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = IgnoreAutoConfiguredSkipPatternsIntegrationTests.Config.class)
-public class IgnoreAutoConfiguredSkipPatternsIntegrationTests
- extends org.springframework.cloud.sleuth.instrument.web.IgnoreAutoConfiguredSkipPatternsIntegrationTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithContextPathWithBasePath.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithContextPathWithBasePath.java
deleted file mode 100644
index 0c82edbcc..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithContextPathWithBasePath.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = SkipEndPointsIntegrationTestsWithContextPathWithBasePath.Config.class)
-public class SkipEndPointsIntegrationTestsWithContextPathWithBasePath extends
- org.springframework.cloud.sleuth.instrument.web.SkipEndPointsIntegrationTestsWithContextPathWithBasePath {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath.java
deleted file mode 100644
index bd8ed7c04..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath.Config.class)
-public class SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath extends
- org.springframework.cloud.sleuth.instrument.web.SkipEndPointsIntegrationTestsWithContextPathWithoutBasePath {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath.java
deleted file mode 100644
index 1f54f21b1..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath.Config.class)
-public class SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath extends
- org.springframework.cloud.sleuth.instrument.web.SkipEndPointsIntegrationTestsWithoutContextPathWithBasePath {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath.java
deleted file mode 100644
index 112b23c45..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath.Config.class)
-public class SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath extends
- org.springframework.cloud.sleuth.instrument.web.SkipEndPointsIntegrationTestsWithoutContextPathWithoutBasePath {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/TraceFilterTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/TraceFilterTests.java
deleted file mode 100644
index 82de359cf..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/TraceFilterTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web;
-
-import org.springframework.cloud.sleuth.http.HttpServerHandler;
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-/**
- * @author Spencer Gibb
- */
-public class TraceFilterTests extends org.springframework.cloud.sleuth.instrument.web.TraceFilterTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
- @Override
- public HttpServerHandler httpServerHandler() {
- return tracerTest().tracing().httpServerHandler();
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/MultipleAsyncRestTemplateTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/MultipleAsyncRestTemplateTests.java
deleted file mode 100644
index 1f7638ca2..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/MultipleAsyncRestTemplateTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-/**
- * @author Marcin Grzejszczak
- */
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-@ContextConfiguration(classes = MultipleAsyncRestTemplateTests.Config.class)
-public class MultipleAsyncRestTemplateTests
- extends org.springframework.cloud.sleuth.instrument.web.client.MultipleAsyncRestTemplateTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRestTemplateInterceptorIntegrationTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRestTemplateInterceptorIntegrationTests.java
deleted file mode 100644
index d37337129..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRestTemplateInterceptorIntegrationTests.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-/**
- * @author Marcin Grzejszczak
- */
-public class TraceRestTemplateInterceptorIntegrationTests
- extends org.springframework.cloud.sleuth.instrument.web.client.TraceRestTemplateInterceptorIntegrationTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRestTemplateInterceptorTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRestTemplateInterceptorTests.java
deleted file mode 100644
index d5998fce2..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/TraceRestTemplateInterceptorTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import java.util.Map;
-
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-/**
- * @author Dave Syer
- *
- */
-public class TraceRestTemplateInterceptorTests
- extends org.springframework.cloud.sleuth.instrument.web.client.TraceRestTemplateInterceptorTests {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
- @Override
- public void assertThatParentSpanIdSet(Span span, Map headers) {
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/util/SpanUtil.java b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/util/SpanUtil.java
deleted file mode 100644
index 38c88aff1..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/java/org/springframework/cloud/sleuth/util/SpanUtil.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.util;
-
-/**
- * @author Marcin Grzejszczak
- * @since
- */
-public final class SpanUtil {
-
- static final char[] HEX_DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
-
- private SpanUtil() {
- throw new IllegalStateException("Can't instantiate a utility class");
- }
-
- // Represents given long id as 16-character lower-hex string
- public static String idToHex(long id) {
- char[] data = new char[16];
- writeHexLong(data, 0, id);
- return new String(data);
- }
-
- // Inspired by {@code okio.Buffer.writeLong}
- static void writeHexLong(char[] data, int pos, long v) {
- writeHexByte(data, pos + 0, (byte) ((v >>> 56L) & 0xff));
- writeHexByte(data, pos + 2, (byte) ((v >>> 48L) & 0xff));
- writeHexByte(data, pos + 4, (byte) ((v >>> 40L) & 0xff));
- writeHexByte(data, pos + 6, (byte) ((v >>> 32L) & 0xff));
- writeHexByte(data, pos + 8, (byte) ((v >>> 24L) & 0xff));
- writeHexByte(data, pos + 10, (byte) ((v >>> 16L) & 0xff));
- writeHexByte(data, pos + 12, (byte) ((v >>> 8L) & 0xff));
- writeHexByte(data, pos + 14, (byte) (v & 0xff));
- }
-
- static void writeHexByte(char[] data, int pos, byte b) {
- data[pos + 0] = HEX_DIGITS[(b >> 4) & 0xf];
- data[pos + 1] = HEX_DIGITS[b & 0xf];
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/resources/application.yml
deleted file mode 100644
index 9ed06adbb..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-mvc-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/pom.xml
deleted file mode 100644
index 145a6d7d4..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-quartz-otel-tests
- jar
- Spring Cloud Sleuth Otel Quartz Instrumentation Tests
- Spring Cloud Sleuth Otel Quartz Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter-quartz
-
-
- org.springframework.cloud
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/quartz/TracingJobListenerTest.java b/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/quartz/TracingJobListenerTest.java
deleted file mode 100644
index 40c89d042..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/quartz/TracingJobListenerTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.quartz;
-
-import org.springframework.cloud.sleuth.otel.OtelTestTracing;
-import org.springframework.cloud.sleuth.test.TestTracingAware;
-
-public class TracingJobListenerTest extends org.springframework.cloud.sleuth.instrument.quartz.TracingJobListenerTest {
-
- OtelTestTracing testTracing;
-
- @Override
- public TestTracingAware tracerTest() {
- if (this.testTracing == null) {
- this.testTracing = new OtelTestTracing();
- }
- return this.testTracing;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/src/test/resources/application.yml
deleted file mode 100644
index caf171df7..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-quartz-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
-
-spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/pom.xml
deleted file mode 100644
index dd35772a9..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/pom.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-reactor-otel-tests
- jar
- Spring Cloud Sleuth Otel Reactor Instrumentation Tests
- Spring Cloud Sleuth Otel Reactor Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter-webflux
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
- io.projectreactor
- reactor-core
-
-
- io.projectreactor.netty
- reactor-netty-http
-
-
- org.reactivestreams
- reactive-streams
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/FlatMapTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/FlatMapTests.java
deleted file mode 100644
index af7aa35e5..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/FlatMapTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.ote.instrument.reactor;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-import org.junit.jupiter.api.Disabled;
-
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@Disabled("TODO: [OTEL] Otel is leaving garbage in MDC via ScopePassingSpanSubscriber")
-public abstract class FlatMapTests extends org.springframework.cloud.sleuth.instrument.reactor.sample.FlatMapTests {
-
- @Override
- protected Class testConfiguration() {
- return Config.class;
- }
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/FlowsScopePassingSpanSubscriberTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/FlowsScopePassingSpanSubscriberTests.java
deleted file mode 100644
index 94a603f30..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/FlowsScopePassingSpanSubscriberTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.ote.instrument.reactor;
-
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.SpanId;
-import io.opentelemetry.api.trace.TraceFlags;
-import io.opentelemetry.api.trace.TraceId;
-import io.opentelemetry.api.trace.TraceState;
-
-import org.springframework.cloud.sleuth.CurrentTraceContext;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.otel.bridge.OtelAccessor;
-
-/**
- * @author Marcin Grzejszczak
- */
-public class FlowsScopePassingSpanSubscriberTests
- extends org.springframework.cloud.sleuth.instrument.reactor.FlowsScopePassingSpanSubscriberTests {
-
- CurrentTraceContext currentTraceContext = OtelAccessor.currentTraceContext();
-
- TraceContext context = OtelAccessor.traceContext(SpanContext.create(TraceId.fromLongs(1L, 0L), SpanId.fromLong(1L),
- TraceFlags.getSampled(), TraceState.builder().build()));
-
- @Override
- protected CurrentTraceContext currentTraceContext() {
- return this.currentTraceContext;
- }
-
- @Override
- protected TraceContext context() {
- return this.context;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/ScopePassingSpanSubscriberSpringBootTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/ScopePassingSpanSubscriberSpringBootTests.java
deleted file mode 100644
index af54c626f..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/ScopePassingSpanSubscriberSpringBootTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.ote.instrument.reactor;
-
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.SpanId;
-import io.opentelemetry.api.trace.TraceFlags;
-import io.opentelemetry.api.trace.TraceId;
-import io.opentelemetry.api.trace.TraceState;
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.cloud.sleuth.otel.bridge.OtelAccessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Like {@link ScopePassingSpanSubscriberTests}, except this tests wiring with spring boot
- * config.
- */
-@SpringBootTest(classes = ScopePassingSpanSubscriberSpringBootTests.Config.class,
- webEnvironment = SpringBootTest.WebEnvironment.NONE)
-public class ScopePassingSpanSubscriberSpringBootTests
- extends org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriberSpringBootTests {
-
- TraceContext context = OtelAccessor.traceContext(SpanContext.create(TraceId.fromLongs(1L, 0L), SpanId.fromLong(1L),
- TraceFlags.getSampled(), TraceState.builder().build()));
-
- TraceContext context2 = OtelAccessor.traceContext(SpanContext.create(TraceId.fromLongs(1L, 0L), SpanId.fromLong(2L),
- TraceFlags.getSampled(), TraceState.builder().build()));
-
- @Override
- protected TraceContext context() {
- return this.context;
- }
-
- @Override
- protected TraceContext context2() {
- return this.context2;
- }
-
- @Configuration(proxyBeanMethods = false)
- @EnableAutoConfiguration
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/ScopePassingSpanSubscriberTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/ScopePassingSpanSubscriberTests.java
deleted file mode 100644
index 986750a60..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/java/org/springframework/cloud/sleuth/ote/instrument/reactor/ScopePassingSpanSubscriberTests.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.ote.instrument.reactor;
-
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.SpanId;
-import io.opentelemetry.api.trace.TraceFlags;
-import io.opentelemetry.api.trace.TraceId;
-import io.opentelemetry.api.trace.TraceState;
-
-import org.springframework.cloud.sleuth.CurrentTraceContext;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.otel.bridge.OtelAccessor;
-
-/**
- * @author Marcin Grzejszczak
- */
-public class ScopePassingSpanSubscriberTests
- extends org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriberTests {
-
- CurrentTraceContext currentTraceContext = OtelAccessor.currentTraceContext();
-
- TraceContext context = OtelAccessor.traceContext(SpanContext.create(TraceId.fromLongs(1L, 0L), SpanId.fromLong(1L),
- TraceFlags.getSampled(), TraceState.builder().build()));
-
- TraceContext context2 = OtelAccessor.traceContext(SpanContext.create(TraceId.fromLongs(1L, 0L), SpanId.fromLong(2L),
- TraceFlags.getSampled(), TraceState.builder().build()));
-
- @Override
- protected CurrentTraceContext currentTraceContext() {
- return this.currentTraceContext;
- }
-
- @Override
- protected TraceContext context() {
- return this.context;
- }
-
- @Override
- protected TraceContext context2() {
- return this.context2;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/resources/application.yml
deleted file mode 100644
index 9ed06adbb..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-reactor-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-rxjava-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-rxjava-tests/pom.xml
deleted file mode 100644
index d107c1ddb..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-rxjava-tests/pom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-rxjava-otel-tests
- jar
- Spring Cloud Sleuth Otel RxJava Instrumentation Tests
- Spring Cloud Sleuth Otel RxJava Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
- io.reactivex
- rxjava
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-rxjava-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-rxjava-tests/src/test/resources/application.yml
deleted file mode 100644
index 2ffa52976..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-rxjava-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
-
-# comma separated list of matchers
-spring.sleuth.rxjava.schedulers.ignoredthreads: HystixMetricPoller,^MyCustomThread.*$,^RxComputation.*$
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-scheduling-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-scheduling-tests/pom.xml
deleted file mode 100644
index d796f3380..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-scheduling-tests/pom.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-scheduling-otel-tests
- jar
- Spring Cloud Sleuth Otel Scheduling Instrumentation Tests
- Spring Cloud Sleuth Otel Scheduling Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-scheduling-tests/src/test/resources/application.yml b/tests/otel/spring-cloud-sleuth-instrumentation-scheduling-tests/src/test/resources/application.yml
deleted file mode 100644
index a85d3e0c8..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-scheduling-tests/src/test/resources/application.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-logging.level.org.springframework.cloud: DEBUG
-logging.level.com.netflix.discovery.InstanceInfoReplicator: ERROR
-logging.level.org.springframework.cloud.sleuth.brave.instrument.web.client.feign: TRACE
-
-spring.sleuth.scheduled.skipPattern: "^org.*TestBeanWithScheduledMethodToBeIgnored$"
\ No newline at end of file
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/pom.xml b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/pom.xml
deleted file mode 100644
index d5fd9d6d0..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/pom.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
- 4.0.0
-
- spring-cloud-sleuth-instrumentation-webflux-otel-tests
- jar
- Spring Cloud Sleuth Otel WebFlux Instrumentation Tests
- Spring Cloud Sleuth Otel WebFlux Instrumentation Tests
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel-tests
- 3.0.0-SNAPSHOT
- ..
-
-
-
- true
-
-
-
-
-
-
- maven-deploy-plugin
-
- true
-
-
-
-
-
-
-
- ${project.groupId}
- spring-cloud-sleuth-tests-common
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter-actuator
-
-
- org.springframework.cloud
- spring-cloud-starter-loadbalancer
-
-
- org.springframework.cloud
- spring-cloud-starter-openfeign
-
-
- org.springframework.cloud
- spring-cloud-starter-sleuth
-
-
- org.springframework.cloud
- spring-cloud-sleuth-brave
-
-
-
-
- org.springframework.cloud
- spring-cloud-sleuth-otel
-
-
- org.springframework.boot
- spring-boot-starter-webflux
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.cloud
- spring-cloud-sleuth-instrumentation
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
- org.awaitility
- awaitility
-
-
- com.squareup.okhttp3
- mockwebserver
-
-
- com.squareup.okhttp3
- okhttp
-
- 4.8.0
-
-
-
-
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/baggage/Service1Controller.java b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/baggage/Service1Controller.java
deleted file mode 100644
index c36816579..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/baggage/Service1Controller.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.baggage;
-
-import java.lang.invoke.MethodHandles;
-
-import io.opentelemetry.api.baggage.Baggage;
-import io.opentelemetry.context.Scope;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import reactor.core.publisher.Mono;
-
-import org.springframework.cloud.sleuth.BaggageInScope;
-import org.springframework.cloud.sleuth.Span;
-import org.springframework.cloud.sleuth.Tracer;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.reactive.function.client.WebClient;
-
-@RestController
-public class Service1Controller {
-
- private final Service2Client service2Client;
-
- public Service1Controller(Service2Client service2Client) {
- this.service2Client = service2Client;
- }
-
- @GetMapping("/start")
- public Mono start() {
- return this.service2Client.start();
- }
-
- @GetMapping("/startWithOtel")
- public Mono startOtel() {
- return this.service2Client.startWithOtelOnly();
- }
-
-}
-
-@Component
-class Service2Client {
-
- private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
- private final WebClient webClient;
-
- private final String serviceAddress;
-
- private final Tracer tracer;
-
- String superSecretBaggage;
-
- String baggageKey;
-
- Service2Client(WebClient webClient, String serviceAddress, Tracer tracer) {
- this.webClient = webClient;
- this.serviceAddress = serviceAddress;
- this.tracer = tracer;
- }
-
- public Mono start() {
- log.info("Hello from service1. Setting baggage foo=>bar");
- Span span = tracer.currentSpan();
- BaggageInScope secretBaggageField = this.tracer.getBaggage("baggage");
- String secretBaggage = secretBaggageField != null ? secretBaggageField.get() : null;
- log.info("Super secret baggage item for key [baggage] is [{}]", secretBaggage);
- this.superSecretBaggage = secretBaggage;
- if (StringUtils.hasText(secretBaggage)) {
- span.event("secret_baggage_received");
- span.tag("baggage", secretBaggage);
- }
- String baggageKey = "key";
- String baggageValue = "foo";
- BaggageInScope baggageField = this.tracer.createBaggage(baggageKey);
- baggageField.set(span.context(), baggageValue);
- span.event("baggage_set");
- span.tag(baggageKey, baggageValue);
- log.info("Hello from service1. Calling service2");
- return webClient.get().uri(serviceAddress + "/foo").exchange().doOnSuccess(clientResponse -> {
- log.info("Got response from service2 [{}]", clientResponse);
- try (BaggageInScope bs = baggageField.makeCurrent()) {
- this.baggageKey = bs.get();
- log.info("Service1: Baggage for [key] is [" + (bs == null ? null : bs.get()) + "]");
- }
- }).flatMap(clientResponse -> clientResponse.bodyToMono(String.class)).doOnTerminate(() -> {
- if (secretBaggageField != null) {
- secretBaggageField.close();
- }
- baggageField.close();
- });
- }
-
- public Mono startWithOtelOnly() {
- log.info("Hello from service1. Setting baggage foo=>bar");
- io.opentelemetry.api.trace.Span span = io.opentelemetry.api.trace.Span.current();
- String secretBaggage = Baggage.current().getEntryValue("baggage");
- log.info("Super secret baggage item for key [baggage] is [{}]", secretBaggage);
- this.superSecretBaggage = secretBaggage;
- if (StringUtils.hasText(secretBaggage)) {
- span.addEvent("secret_baggage_received");
- span.setAttribute("baggage", secretBaggage);
- }
- String baggageKey = "key";
- String baggageValue = "foo";
- Baggage baggage = Baggage.builder().put(baggageKey, baggageValue).build();
- Scope baggageField = baggage.makeCurrent();
- span.addEvent("baggage_set");
- span.setAttribute(baggageKey, baggageValue);
- log.info("Hello from service1. Calling service2");
- return webClient.get().uri(serviceAddress + "/foo").exchange().doOnSuccess(clientResponse -> {
- log.info("Got response from service2 [{}]", clientResponse);
- // This will not work
- // String key = Baggage.current().getEntryValue("key");
- try (Scope scope = baggage.makeCurrent()) {
- String key = Baggage.current().getEntryValue("key");
- this.baggageKey = key;
- log.info("Service1: Baggage for [key] is [" + key + "]");
- }
- }).flatMap(clientResponse -> clientResponse.bodyToMono(String.class)).doOnTerminate(baggageField::close);
- }
-
- String getSuperSecretBaggage() {
- return this.superSecretBaggage;
- }
-
- String getBaggageKey() {
- return this.baggageKey;
- }
-
- void reset() {
- this.superSecretBaggage = null;
- this.baggageKey = null;
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/baggage/WebFluxBaggageTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/baggage/WebFluxBaggageTests.java
deleted file mode 100644
index c4b8c925c..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/baggage/WebFluxBaggageTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.baggage;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.concurrent.TimeUnit;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-import okhttp3.mockwebserver.MockResponse;
-import okhttp3.mockwebserver.MockWebServer;
-import okhttp3.mockwebserver.RecordedRequest;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.ValueSource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.web.client.TestRestTemplate;
-import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.cloud.sleuth.Tracer;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.RequestEntity;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.web.reactive.function.client.WebClient;
-
-import static org.assertj.core.api.BDDAssertions.then;
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
-
-@SpringBootTest(webEnvironment = RANDOM_PORT, classes = WebFluxBaggageTests.Config.class,
- properties = "spring.main.web-application-type=REACTIVE")
-@ActiveProfiles("baggage")
-public class WebFluxBaggageTests {
-
- @LocalServerPort
- int port;
-
- @Autowired
- Service2Client service2Client;
-
- @Autowired
- MockWebServer mockWebServer;
-
- @BeforeEach
- void setup() {
- this.service2Client.reset();
- }
-
- @ParameterizedTest
- @ValueSource(strings = { "/start", "/startWithOtel" })
- void should_propagate_baggage(String path) throws InterruptedException {
- this.mockWebServer.enqueue(new MockResponse().setBody("hello"));
-
- String response = requestWithBaggage(path);
-
- then(response).as("Request was sent and response received").isEqualTo("hello");
- thenBaggageWasProperlyPropagatedWithinWebFlux();
- thenBaggageWasPropagatedViaHttpClient();
- }
-
- private String requestWithBaggage(String path) {
- return new TestRestTemplate().exchange(
- RequestEntity.get(URI.create("http://localhost:" + port + path)).header("baggage", "super").build(),
- String.class).getBody();
- }
-
- private void thenBaggageWasPropagatedViaHttpClient() throws InterruptedException {
- RecordedRequest recordedRequest = this.mockWebServer.takeRequest(1, TimeUnit.SECONDS);
- then(recordedRequest).isNotNull();
- then(recordedRequest.getHeader("baggage")).isEqualTo("super");
- then(recordedRequest.getHeader("key")).isEqualTo("foo");
- }
-
- private void thenBaggageWasProperlyPropagatedWithinWebFlux() {
- then(service2Client.getSuperSecretBaggage()).isEqualTo("super");
- then(service2Client.getBaggageKey()).isEqualTo("foo");
- }
-
- @EnableAutoConfiguration
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- MockWebServer mockWebServer() throws IOException {
- MockWebServer mockWebServer = new MockWebServer();
- mockWebServer.start();
- return mockWebServer;
- }
-
- @Bean
- WebClient.Builder webClientBuilder() {
- return WebClient.builder();
- }
-
- @Bean
- Service2Client service2Client(WebClient.Builder builder, MockWebServer mockWebServer, Tracer tracer) {
- return new Service2Client(builder.build(), mockWebServer.url("/").toString(), tracer);
- }
-
- @Bean
- Service1Controller controller(Service2Client service2Client) {
- return new Service1Controller(service2Client);
- }
-
- @Bean
- OtelTestSpanHandler testSpanHandler() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/HttpClientBeanPostProcessorTest.java b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/HttpClientBeanPostProcessorTest.java
deleted file mode 100644
index b58118a26..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/HttpClientBeanPostProcessorTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.SpanId;
-import io.opentelemetry.api.trace.TraceFlags;
-import io.opentelemetry.api.trace.TraceId;
-import io.opentelemetry.api.trace.TraceState;
-
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.otel.bridge.OtelAccessor;
-
-public class HttpClientBeanPostProcessorTest
- extends org.springframework.cloud.sleuth.instrument.web.client.HttpClientBeanPostProcessorTest {
-
- @Override
- public TraceContext traceContext() {
- return OtelAccessor.traceContext(SpanContext.create(TraceId.fromLongs(1L, 0L), SpanId.fromLong(2L),
- TraceFlags.getSampled(), TraceState.builder().build()));
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/ReactorNettyHttpClientSpringBootTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/ReactorNettyHttpClientSpringBootTests.java
deleted file mode 100644
index 46373dea5..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/ReactorNettyHttpClientSpringBootTests.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import io.opentelemetry.api.trace.SpanContext;
-import io.opentelemetry.api.trace.SpanId;
-import io.opentelemetry.api.trace.TraceFlags;
-import io.opentelemetry.api.trace.TraceId;
-import io.opentelemetry.api.trace.TraceState;
-import io.opentelemetry.context.propagation.TextMapPropagator;
-import io.opentelemetry.extension.trace.propagation.B3Propagator;
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-import org.assertj.core.api.Assertions;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.TraceContext;
-import org.springframework.cloud.sleuth.exporter.FinishedSpan;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.cloud.sleuth.otel.bridge.OtelAccessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.TestPropertySource;
-
-@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
-@ContextConfiguration(classes = ReactorNettyHttpClientSpringBootTests.Config.class)
-@TestPropertySource(properties = "spring.sleuth.otel.propagation.type=custom")
-public class ReactorNettyHttpClientSpringBootTests
- extends org.springframework.cloud.sleuth.instrument.web.client.ReactorNettyHttpClientSpringBootTests {
-
- @Override
- public TraceContext traceContext() {
- return OtelAccessor.traceContext(SpanContext.create(TraceId.fromLongs(1L, 0L), SpanId.fromLong(2L),
- TraceFlags.getSampled(), TraceState.builder().build()));
- }
-
- @Override
- public void assertSingleB3Header(String b3SingleHeaderReadByServer, FinishedSpan clientSpan, TraceContext parent) {
- Assertions.assertThat(b3SingleHeaderReadByServer)
- .isEqualTo(parent.traceId() + "-" + clientSpan.getSpanId() + "-1");
- }
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- TextMapPropagator otelTextMapPropagator() {
- return B3Propagator.getInstance();
- }
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientCustomParserTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientCustomParserTests.java
deleted file mode 100644
index d6f9f81e7..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientCustomParserTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
-
-@SpringBootTest(webEnvironment = RANDOM_PORT)
-@ContextConfiguration(classes = WebClientCustomParserTests.Config.class)
-public class WebClientCustomParserTests
- extends org.springframework.cloud.sleuth.instrument.web.client.integration.parser.WebClientCustomParserTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientDiscoveryExceptionTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientDiscoveryExceptionTests.java
deleted file mode 100644
index 7b94406f3..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientDiscoveryExceptionTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.ContextConfiguration;
-
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
-
-@SpringBootTest(webEnvironment = RANDOM_PORT)
-@ContextConfiguration(classes = WebClientDiscoveryExceptionTests.Config.class)
-public class WebClientDiscoveryExceptionTests extends
- org.springframework.cloud.sleuth.instrument.web.client.discoveryexception.WebClientDiscoveryExceptionTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientExceptionTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientExceptionTests.java
deleted file mode 100644
index e2fefab9c..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientExceptionTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@SpringBootTest(classes = { WebClientExceptionTests.Config.class,
- org.springframework.cloud.sleuth.instrument.web.client.exception.WebClientExceptionTests.TestConfiguration.class },
- properties = { "spring.application.name=exceptionservice" },
- webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-public class WebClientExceptionTests
- extends org.springframework.cloud.sleuth.instrument.web.client.exception.WebClientExceptionTests {
-
- @Configuration(proxyBeanMethods = false)
- static class Config {
-
- @Bean
- OtelTestSpanHandler testSpanHandlerSupplier() {
- return new OtelTestSpanHandler(new ArrayListSpanProcessor());
- }
-
- @Bean
- Sampler alwaysSampler() {
- return Sampler.alwaysOn();
- }
-
- }
-
-}
diff --git a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientNotSampledTests.java b/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientNotSampledTests.java
deleted file mode 100644
index bd17e5b7b..000000000
--- a/tests/otel/spring-cloud-sleuth-instrumentation-webflux-tests/src/test/java/org/springframework/cloud/sleuth/otel/instrument/web/client/WebClientNotSampledTests.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2013-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.sleuth.otel.instrument.web.client;
-
-import java.util.Map;
-
-import io.opentelemetry.sdk.trace.samplers.Sampler;
-
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
-import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.ResponseEntity;
-import org.springframework.test.context.ContextConfiguration;
-
-import static org.assertj.core.api.BDDAssertions.then;
-import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
-
-@SpringBootTest(webEnvironment = RANDOM_PORT)
-@ContextConfiguration(classes = WebClientNotSampledTests.Config.class)
-public class WebClientNotSampledTests
- extends org.springframework.cloud.sleuth.instrument.web.client.integration.notsampled.WebClientNotSampledTests {
-
- @Override
- public void assertB3SingleNotSampled(ResponseEntity