Skip to content

Commit dbd26e5

Browse files
Fixed docs & Benchmarks
1 parent 6460694 commit dbd26e5

File tree

54 files changed

+46
-4058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+46
-4058
lines changed

benchmarks/pom.xml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<description>Benchmarks (JMH)</description>
2424
<groupId>org.springframework.cloud</groupId>
2525
<version>3.0.0-SNAPSHOT</version>
26-
<artifactId>benchmarks</artifactId>
26+
<artifactId>otel-benchmarks</artifactId>
2727

2828
<parent>
2929
<groupId>org.springframework.boot</groupId>
@@ -41,6 +41,7 @@
4141
<okhttp.version>4.9.0</okhttp.version>
4242
<microbenchmark-runner.version>0.2.0.RELEASE</microbenchmark-runner.version>
4343
<jmh.version>1.21</jmh.version>
44+
<spring-cloud-sleuth.version>3.0.0-SNAPSHOT</spring-cloud-sleuth.version>
4445
<spring-cloud-stream.version>3.1.0-SNAPSHOT</spring-cloud-stream.version>
4546
</properties>
4647

@@ -49,6 +50,13 @@
4950
<dependency>
5051
<groupId>org.springframework.cloud</groupId>
5152
<artifactId>spring-cloud-sleuth-dependencies</artifactId>
53+
<version>${spring-cloud-sleuth.version}</version>
54+
<type>pom</type>
55+
<scope>import</scope>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.springframework.cloud</groupId>
59+
<artifactId>spring-cloud-sleuth-otel-dependencies</artifactId>
5260
<version>${project.version}</version>
5361
<type>pom</type>
5462
<scope>import</scope>
@@ -67,6 +75,12 @@
6775
<dependency>
6876
<groupId>${project.groupId}</groupId>
6977
<artifactId>spring-cloud-starter-sleuth</artifactId>
78+
<exclusions>
79+
<exclusion>
80+
<groupId>org.springframework.cloud</groupId>
81+
<artifactId>spring-cloud-sleuth-brave</artifactId>
82+
</exclusion>
83+
</exclusions>
7084
</dependency>
7185
<dependency>
7286
<groupId>${project.groupId}</groupId>
@@ -143,10 +157,6 @@
143157
<version>${okhttp.version}</version>
144158
<scope>provided</scope>
145159
</dependency>
146-
<dependency>
147-
<groupId>io.zipkin.brave</groupId>
148-
<artifactId>brave-instrumentation-httpclient</artifactId>
149-
</dependency>
150160
<dependency>
151161
<groupId>org.apache.httpcomponents</groupId>
152162
<artifactId>httpclient</artifactId>

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/SampleTests.java

Lines changed: 0 additions & 164 deletions
This file was deleted.

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/TracerImplementation.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,6 @@
2121

2222
public enum TracerImplementation {
2323

24-
otel(BraveAutoConfiguration.class.getCanonicalName()), brave(OtelAutoConfiguration.class.getCanonicalName());
25-
26-
private String key = "spring.autoconfigure.exclude";
27-
28-
private String value;
29-
30-
TracerImplementation(String value) {
31-
this.value = value;
32-
}
33-
34-
public String property() {
35-
return "--" + this.key + "=" + this.value;
36-
}
37-
38-
@Override
39-
public String toString() {
40-
return this.name();
41-
}
24+
otel;
4225

4326
}

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/bridge/BridgeTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static class BenchmarkContext {
106106
public void setup() {
107107
SpringApplication application = new SpringApplication(TestConfiguration.class);
108108
application.setWebApplicationType(WebApplicationType.NONE);
109-
this.withSleuth = application.run("--spring.jmx.enabled=false", this.tracerImplementation.property(),
109+
this.withSleuth = application.run("--spring.jmx.enabled=false",
110110
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
111111
this.tracer = this.withSleuth.getBean(Tracer.class);
112112
this.parent = this.tracer.nextSpan().name("name").start();

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AnnotationBenchmarksTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public static class BenchmarkContext {
7272
@Setup
7373
public void setup() {
7474
this.withSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run("--spring.jmx.enabled=false",
75-
this.tracerImplementation.property(),
7675
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
7776
this.sleuth = this.withSleuth.getBean(SleuthBenchmarkingSpringApp.class);
7877
}

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/AsyncBenchmarksTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public static class BenchmarkContext {
7676
@Setup
7777
public void setup() {
7878
this.withSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run("--spring.jmx.enabled=false",
79-
this.tracerImplementation.property(),
8079
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
8180
this.withoutSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run(
8281
"--spring.jmx.enabled=false", "--spring.application.name=withoutSleuth",

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/HttpFilterBenchmarksTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ public static class BenchmarkContext {
139139
@Setup
140140
public void setup() {
141141
this.withSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run("--spring.jmx.enabled=false",
142-
this.tracerImplementation.property(),
143142
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
144143
this.tracingFilter = this.withSleuth.getBean(TracingFilter.class);
145144
this.mockMvcForTracedController = MockMvcBuilders

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/RestTemplateBenchmarkTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public static class BenchmarkContext {
8888
@Setup
8989
public void setup() {
9090
this.withSleuth = new SpringApplication(SleuthBenchmarkingSpringApp.class).run("--spring.jmx.enabled=false",
91-
this.tracerImplementation.property(),
9291
"--spring.application.name=withSleuth_" + this.tracerImplementation.name());
9392
this.mockMvc = MockMvcBuilders.standaloneSetup(this.withSleuth.getBean(SleuthBenchmarkingSpringApp.class))
9493
.build();

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/mvc/StartupBenchmarkTests.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,27 @@ public void withAnnotations(ApplicationState state) throws Exception {
4848

4949
@Benchmark
5050
public void withoutAnnotations(ApplicationState state) throws Exception {
51-
state.setExtraArgs("--spring.sleuth.annotation.enabled=false", state.tracerImplementation.property());
51+
state.setExtraArgs("--spring.sleuth.annotation.enabled=false");
5252
state.run();
5353
}
5454

5555
@Benchmark
5656
public void withoutAsync(ApplicationState state) throws Exception {
57-
state.setExtraArgs("--spring.sleuth.async.enabled=false", "--spring.sleuth.annotation.enabled=false",
58-
state.tracerImplementation.property());
57+
state.setExtraArgs("--spring.sleuth.async.enabled=false", "--spring.sleuth.annotation.enabled=false");
5958
state.run();
6059
}
6160

6261
@Benchmark
6362
public void withoutScheduled(ApplicationState state) throws Exception {
6463
state.setExtraArgs("--spring.sleuth.scheduled.enabled=false", "--spring.sleuth.async.enabled=false",
65-
"--spring.sleuth.annotation.enabled=false", state.tracerImplementation.property());
64+
"--spring.sleuth.annotation.enabled=false");
6665
state.run();
6766
}
6867

6968
@Benchmark
7069
public void withoutWeb(ApplicationState state) throws Exception {
7170
state.setExtraArgs("--spring.sleuth.web.enabled=false", "--spring.sleuth.scheduled.enabled=false",
72-
"--spring.sleuth.async.enabled=false", "--spring.sleuth.annotation.enabled=false",
73-
state.tracerImplementation.property());
71+
"--spring.sleuth.async.enabled=false", "--spring.sleuth.annotation.enabled=false");
7472
state.run();
7573
}
7674

benchmarks/src/test/java/org/springframework/cloud/sleuth/benchmarks/jmh/stream/MicroBenchmarkStreamTests.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.concurrent.TimeUnit;
2525
import java.util.stream.Collectors;
2626

27-
import brave.Tracing;
2827
import jmh.mbr.junit5.Microbenchmark;
2928
import org.junit.platform.commons.annotation.Testable;
3029
import org.openjdk.jmh.annotations.Benchmark;
@@ -107,7 +106,7 @@ protected ConfigurableApplicationContext initContext() {
107106

108107
protected String[] runArgs() {
109108
List<String> strings = new ArrayList<>();
110-
strings.addAll(Arrays.asList("--spring.jmx.enabled=false", this.tracerImplementation.property(),
109+
strings.addAll(Arrays.asList("--spring.jmx.enabled=false",
111110
"--spring.application.name=defaultTraceContextForStream" + instrumentation.name() + "_"
112111
+ tracerImplementation.name()));
113112
strings.addAll(instrumentation.entires.stream().map(s -> "--" + s).collect(Collectors.toList()));
@@ -141,10 +140,6 @@ private void assertThatOutputMessageGotReceived() {
141140

142141
@TearDown
143142
public void clean() throws Exception {
144-
Tracing current = Tracing.current();
145-
if (current != null) {
146-
current.close();
147-
}
148143
try {
149144
this.applicationContext.close();
150145
}

0 commit comments

Comments
 (0)