Skip to content

Commit cee8be1

Browse files
committed
feat(springboot 2): add support for springboot v2
1 parent 56da26a commit cee8be1

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

docker/applicationinsights.json

+9
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,14 @@
22
"selfDiagnostics": {
33
"destination": "console",
44
"level": "INFO"
5+
},
6+
"sampling": {
7+
"percentage": 5,
8+
"overrides": [
9+
{
10+
"telemetryType": "exception",
11+
"percentage": 100
12+
}
13+
]
514
}
615
}

docker/run.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
#!/bin/sh
22

3+
version=$(cat META-INF/MANIFEST.MF | grep -oP 'Spring-Boot-Version: \K[\d.]+')
4+
version_major=${version:0:1}
5+
6+
# Check if the version_major is 3
7+
if [[ "$version_major" == "3" ]]; then
38
exec java -javaagent:/applicationinsights-agent.jar ${JAVA_OPTS} org.springframework.boot.loader.launch.JarLauncher "$@"
9+
else
10+
exec java -javaagent:/applicationinsights-agent.jar ${JAVA_OPTS} org.springframework.boot.loader.JarLauncher "$@"
11+
fi

0 commit comments

Comments
 (0)