Skip to content

Commit 04bbb4d

Browse files
committed
Add WebFlux routing instrumentation
1 parent a51a812 commit 04bbb4d

File tree

10 files changed

+9
-3
lines changed

10 files changed

+9
-3
lines changed

agent/instrumentation/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ dependencies {
4646
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-opentelemetry-api-0.2.0', version: instrumentationVersion
4747
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-opentelemetry-api-0.2.4', version: instrumentationVersion
4848
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-opentelemetry-api-0.3', version: instrumentationVersion
49+
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-reactor-3.1', version: instrumentationVersion
4950
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-request-2.3', version: instrumentationVersion
5051
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-request-3.0', version: instrumentationVersion
5152
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-spring-scheduling-3.1', version: instrumentationVersion
5253
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-spring-webmvc-3.1', version: instrumentationVersion
54+
compile group: 'io.opentelemetry.auto.instrumentation', name: 'instrumentation-spring-webflux-5.0', version: instrumentationVersion
5355

5456
// also: jaxrs, spring, struts
5557

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ include ':test:smoke:testApps:HttpClients'
7676
include ':test:smoke:testApps:WebAuto'
7777
include ':test:smoke:testApps:SpringBoot1_3Auto'
7878
include ':test:smoke:testApps:SpringBootAuto'
79-
include ':test:smoke:testApps:Netty'
79+
include ':test:smoke:testApps:WebFlux'
8080
include ':test:smoke:testApps:JMS'
8181
include ':test:smoke:testApps:Kafka'
8282
include ':test:smoke:testApps:SpringCloudStream'
File renamed without changes.

test/smoke/testApps/Netty/src/main/java/com/microsoft/ajl/simple/TestController.java renamed to test/smoke/testApps/WebFlux/src/main/java/com/microsoft/ajl/simple/TestController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public String root() {
1616
return "OK";
1717
}
1818

19-
@GetMapping("/test")
19+
@GetMapping("/test/**")
2020
public Mono<String> test() {
2121
CompletableFuture<String> completableFuture = new CompletableFuture<>();
2222
Executors.newSingleThreadExecutor().execute(new Runnable() {
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,28 @@
1010
import static org.junit.Assert.*;
1111

1212
@UseAgent
13-
public class NettyTest extends AiSmokeTest {
13+
public class WebFluxTest extends AiSmokeTest {
1414

1515
@Test
1616
@TargetUri("/test")
1717
public void doMostBasicTest() throws Exception {
1818
List<Envelope> rdList = mockedIngestion.waitForItems("RequestData", 1);
19+
assertEquals(0, mockedIngestion.getCountForType("RemoteDependencyData"));
1920

2021
Envelope rdEnvelope = rdList.get(0);
2122

2223
RequestData rd = (RequestData) ((Data) rdEnvelope.getData()).getBaseData();
2324

2425
assertTrue(rd.getSuccess());
26+
assertEquals("GET /test/**", rd.getName());
2527
assertEquals("200", rd.getResponseCode());
2628
}
2729

2830
@Test
2931
@TargetUri("/exception")
3032
public void testException() throws Exception {
3133
List<Envelope> rdList = mockedIngestion.waitForItems("RequestData", 1);
34+
assertEquals(0, mockedIngestion.getCountForType("RemoteDependencyData"));
3235

3336
Envelope rdEnvelope = rdList.get(0);
3437

@@ -42,6 +45,7 @@ public void testException() throws Exception {
4245
@TargetUri("/futureException")
4346
public void testFutureException() throws Exception {
4447
List<Envelope> rdList = mockedIngestion.waitForItems("RequestData", 1);
48+
assertEquals(0, mockedIngestion.getCountForType("RemoteDependencyData"));
4549

4650
Envelope rdEnvelope = rdList.get(0);
4751

File renamed without changes.

0 commit comments

Comments
 (0)