-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
Submodule opentelemetry-auto-instr-java
updated
from 190b63 to b7b07f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '2.1.7.RELEASE' | ||
} | ||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
compileSmokeTestJava.sourceCompatibility = 1.8 | ||
compileSmokeTestJava.targetCompatibility = 1.8 | ||
|
||
ext.testAppArtifactDir = jar.destinationDirectory | ||
ext.testAppArtifactFilename = jar.archiveFileName.get() | ||
|
||
dependencies { | ||
compileOnly aiAgentJar // this is just to force building the agent first | ||
|
||
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.1.7.RELEASE' | ||
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: '2.1.7.RELEASE' | ||
} |
13 changes: 13 additions & 0 deletions
13
.../smoke/testApps/ActuatorMetrics/src/main/java/com/microsoft/ajl/simple/SpringBootApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.microsoft.ajl.simple; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class SpringBootApp { | ||
|
||
public static void main(String[] args) { | ||
|
||
SpringApplication.run(SpringBootApp.class, args); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...smoke/testApps/ActuatorMetrics/src/main/java/com/microsoft/ajl/simple/TestController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.microsoft.ajl.simple; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class TestController { | ||
|
||
@GetMapping("/") | ||
public String root() { | ||
return "OK"; | ||
} | ||
|
||
@GetMapping("/test") | ||
public String test() { | ||
return "OK!"; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
test/smoke/testApps/ActuatorMetrics/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
management.metrics.export.azuremonitor.instrumentation-key=00000000-0000-0000-0000-000000000000 |
40 changes: 40 additions & 0 deletions
40
...etrics/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/MicrometerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.microsoft.applicationinsights.smoketest; | ||
|
||
import java.util.List; | ||
|
||
import com.microsoft.applicationinsights.internal.schemav2.DataPoint; | ||
import com.microsoft.applicationinsights.internal.schemav2.DataPointType; | ||
import com.microsoft.applicationinsights.internal.schemav2.MetricData; | ||
import org.junit.*; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
@UseAgent("Micrometer") | ||
public class MicrometerTest extends AiSmokeTest { | ||
|
||
@Test | ||
@TargetUri("/test") | ||
public void doMostBasicTest() throws Exception { | ||
mockedIngestion.waitForItems("RequestData", 1); | ||
|
||
mockedIngestion.waitForItems("MetricData", 1); | ||
|
||
List<MetricData> metrics = mockedIngestion.getTelemetryDataByType("MetricData"); | ||
|
||
assertEquals(1, metrics.size()); | ||
|
||
List<DataPoint> points = metrics.get(0).getMetrics(); | ||
|
||
assertEquals(1, points.size()); | ||
|
||
DataPoint point = points.get(0); | ||
|
||
assertEquals(DataPointType.Measurement, point.getKind()); | ||
assertEquals(1, point.getValue(), 0); | ||
assertEquals("test_counter", point.getName()); | ||
assertNull("getCount was non-null", point.getCount()); | ||
assertNull("getMin was non-null", point.getMin()); | ||
assertNull("getMax was non-null", point.getMax()); | ||
assertNull("getStdDev was non-null", point.getStdDev()); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
test/smoke/testApps/ActuatorMetrics/src/smokeTest/resources/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`jre.excludes.txt` is needed because Spring Boot 2 and Micrometer do not support Java 7 |
1 change: 1 addition & 0 deletions
1
test/smoke/testApps/ActuatorMetrics/src/smokeTest/resources/appServers.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
javase |
1 change: 1 addition & 0 deletions
1
test/smoke/testApps/ActuatorMetrics/src/smokeTest/resources/jre.excludes.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
azul/zulu-openjdk:7 |
12 changes: 12 additions & 0 deletions
12
test/smoke/testApps/ActuatorMetrics/src/smokeTest/resources/logback-test.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE configuration> | ||
<configuration> | ||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
<root level="warn"> | ||
<appender-ref ref="CONSOLE" /> | ||
</root> | ||
</configuration> |