Skip to content

Commit bd149ce

Browse files
Improvement with Reactor instrumentation
- adds Spring Cloud Function instrumentation - adds Operators to manually provide instrumentation for Fluxes - introduces Manual instrumentation mode for Reactor TODO: Documentation (will add it soon) related gh-1684
1 parent fb433b4 commit bd149ce

File tree

366 files changed

+2863
-721
lines changed

Some content is hidden

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

366 files changed

+2863
-721
lines changed

benchmarks/pom.xml

+41-100
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,23 @@
2525
<version>3.0.0-SNAPSHOT</version>
2626
<artifactId>benchmarks</artifactId>
2727

28+
<parent>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-parent</artifactId>
31+
<version>2.4.0-M1</version>
32+
<relativePath/> <!-- lookup parent from repository -->
33+
</parent>
34+
2835
<properties>
2936
<main.basedir>${project.basedir}/..</main.basedir>
30-
<jmh.version>1.22</jmh.version>
3137
<maven-shade-plugin.version>3.2.1</maven-shade-plugin.version>
3238
<sonar.skip>true</sonar.skip>
3339
<maven.compiler.target>1.8</maven.compiler.target>
3440
<maven.compiler.source>1.8</maven.compiler.source>
35-
<spring-boot.version>2.4.0-M1</spring-boot.version>
36-
<brave.version>5.12.3</brave.version>
3741
<okhttp.version>3.14.6</okhttp.version>
42+
<microbenchmark-runner.version>0.2.0.RELEASE</microbenchmark-runner.version>
43+
<jmh.version>1.21</jmh.version>
44+
<spring-cloud-stream.version>3.1.0-SNAPSHOT</spring-cloud-stream.version>
3845
</properties>
3946

4047
<dependencyManagement>
@@ -47,10 +54,9 @@
4754
<scope>import</scope>
4855
</dependency>
4956
<dependency>
50-
<!-- Import dependency management from Spring Boot -->
51-
<groupId>org.springframework.boot</groupId>
52-
<artifactId>spring-boot-dependencies</artifactId>
53-
<version>${spring-boot.version}</version>
57+
<groupId>org.springframework.cloud</groupId>
58+
<artifactId>spring-cloud-stream-dependencies</artifactId>
59+
<version>${spring-cloud-stream.version}</version>
5460
<type>pom</type>
5561
<scope>import</scope>
5662
</dependency>
@@ -60,7 +66,7 @@
6066
<dependencies>
6167
<dependency>
6268
<groupId>${project.groupId}</groupId>
63-
<artifactId>spring-cloud-sleuth-core</artifactId>
69+
<artifactId>spring-cloud-starter-sleuth</artifactId>
6470
</dependency>
6571
<dependency>
6672
<groupId>org.springframework.boot</groupId>
@@ -91,22 +97,36 @@
9197
<dependency>
9298
<groupId>org.assertj</groupId>
9399
<artifactId>assertj-core</artifactId>
94-
<version>3.14.0</version>
95100
<scope>compile</scope>
96101
</dependency>
97102
<dependency>
98-
<groupId>org.hamcrest</groupId>
99-
<artifactId>hamcrest-core</artifactId>
100-
<version>1.3</version>
103+
<groupId>org.springframework.cloud</groupId>
104+
<artifactId>spring-cloud-starter-stream-kafka</artifactId>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.springframework.cloud</groupId>
108+
<artifactId>spring-cloud-stream</artifactId>
109+
<type>test-jar</type>
101110
<scope>compile</scope>
111+
<classifier>test-binder</classifier>
102112
</dependency>
103-
104113
<dependency>
105-
<groupId>org.openjdk.jmh</groupId>
106-
<artifactId>jmh-core</artifactId>
107-
<version>${jmh.version}</version>
114+
<groupId>org.springframework.boot</groupId>
115+
<artifactId>spring-boot-starter-test</artifactId>
116+
<scope>compile</scope>
117+
</dependency>
118+
<dependency>
119+
<groupId>com.github.mp911de.microbenchmark-runner</groupId>
120+
<artifactId>microbenchmark-runner-junit5</artifactId>
121+
<version>${microbenchmark-runner.version}</version>
122+
<scope>test</scope>
123+
</dependency>
124+
<dependency>
125+
<groupId>com.github.mp911de.microbenchmark-runner</groupId>
126+
<artifactId>microbenchmark-runner-extras</artifactId>
127+
<version>${microbenchmark-runner.version}</version>
128+
<scope>test</scope>
108129
</dependency>
109-
110130
<dependency>
111131
<groupId>org.openjdk.jmh</groupId>
112132
<artifactId>jmh-generator-annprocess</artifactId>
@@ -122,7 +142,6 @@
122142
<dependency>
123143
<groupId>io.zipkin.brave</groupId>
124144
<artifactId>brave-instrumentation-httpclient</artifactId>
125-
<version>${brave.version}</version>
126145
</dependency>
127146
<dependency>
128147
<groupId>org.apache.httpcomponents</groupId>
@@ -140,24 +159,15 @@
140159
<target>${maven.compiler.target}</target>
141160
</configuration>
142161
</plugin>
143-
<plugin>
144-
<!--skip deploy (this is just a test module) -->
145-
<artifactId>maven-deploy-plugin</artifactId>
146-
<configuration>
147-
<skip>true</skip>
148-
</configuration>
149-
</plugin>
150-
<plugin>
151-
<artifactId>maven-install-plugin</artifactId>
152-
<configuration>
153-
<skip>true</skip>
154-
</configuration>
155-
</plugin>
156162
</plugins>
157163
</build>
158164

159165

160166
<repositories>
167+
<repository>
168+
<id>jitpack.io</id>
169+
<url>https://jitpack.io</url>
170+
</repository>
161171
<repository>
162172
<id>spring-snapshots</id>
163173
<name>Spring Snapshots</name>
@@ -229,75 +239,6 @@
229239
</pluginRepositories>
230240

231241
<profiles>
232-
<profile>
233-
<id>jmh</id>
234-
<activation>
235-
<activeByDefault>false</activeByDefault>
236-
</activation>
237-
<build>
238-
<plugins>
239-
<plugin>
240-
<artifactId>maven-shade-plugin</artifactId>
241-
<version>${maven-shade-plugin.version}</version>
242-
<dependencies>
243-
<dependency>
244-
<groupId>org.springframework.boot</groupId>
245-
<artifactId>spring-boot-maven-plugin</artifactId>
246-
<version>${spring-boot.version}</version>
247-
</dependency>
248-
</dependencies>
249-
<configuration>
250-
<keepDependenciesWithProvidedScope>true
251-
</keepDependenciesWithProvidedScope>
252-
<createDependencyReducedPom>true</createDependencyReducedPom>
253-
<filters>
254-
<filter>
255-
<artifact>*:*</artifact>
256-
<excludes>
257-
<exclude>META-INF/*.SF</exclude>
258-
<exclude>META-INF/*.DSA</exclude>
259-
<exclude>META-INF/*.RSA</exclude>
260-
</excludes>
261-
</filter>
262-
</filters>
263-
</configuration>
264-
<executions>
265-
<execution>
266-
<phase>package</phase>
267-
<goals>
268-
<goal>shade</goal>
269-
</goals>
270-
<configuration>
271-
<finalName>benchmarks</finalName>
272-
<transformers>
273-
<transformer
274-
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
275-
<resource>META-INF/spring.handlers</resource>
276-
</transformer>
277-
<transformer
278-
implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
279-
<resource>META-INF/spring.factories</resource>
280-
</transformer>
281-
<transformer
282-
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
283-
<resource>META-INF/spring.schemas</resource>
284-
</transformer>
285-
<transformer
286-
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
287-
<transformer
288-
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
289-
<mainClass>org.openjdk.jmh.Main</mainClass>
290-
</transformer>
291-
</transformers>
292-
<createDependencyReducedPom>false
293-
</createDependencyReducedPom>
294-
</configuration>
295-
</execution>
296-
</executions>
297-
</plugin>
298-
</plugins>
299-
</build>
300-
</profile>
301242
<profile>
302243
<id>jmeter</id>
303244
<activation>

benchmarks/src/main/java/org/springframework/cloud/sleuth/benchmarks/app/mvc/SleuthBenchmarkingSpringApp.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2019 the original author or authors.
2+
* Copyright 2013-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,13 +56,15 @@
5656
@SpringBootApplication
5757
@RestController
5858
@EnableAsync
59-
public class SleuthBenchmarkingSpringApp
60-
implements ApplicationListener<ServletWebServerInitializedEvent> {
59+
public class SleuthBenchmarkingSpringApp implements ApplicationListener<ServletWebServerInitializedEvent> {
6160

6261
private static final Log log = LogFactory.getLog(SleuthBenchmarkingSpringApp.class);
6362

6463
public final ExecutorService pool = Executors.newWorkStealingPool();
6564

65+
/**
66+
* Port of the app.
67+
*/
6668
public int port;
6769

6870
@Autowired(required = false)
@@ -109,11 +111,9 @@ public void onApplicationEvent(ServletWebServerInitializedEvent event) {
109111
}
110112

111113
@Bean
112-
public ServletWebServerFactory servletContainer(
113-
@Value("${server.port:0}") int serverPort) {
114+
public ServletWebServerFactory servletContainer(@Value("${server.port:0}") int serverPort) {
114115
log.info("Starting container at port [" + serverPort + "]");
115-
return new TomcatServletWebServerFactory(
116-
serverPort == 0 ? SocketUtils.findAvailableTcpPort() : serverPort);
116+
return new TomcatServletWebServerFactory(serverPort == 0 ? SocketUtils.findAvailableTcpPort() : serverPort);
117117
}
118118

119119
@PreDestroy

0 commit comments

Comments
 (0)