Skip to content

Commit b6a4b1d

Browse files
Merge pull request #10 from pagopa/PAGOPA-2258-issue-log-verbose-biz-service
feat(springboot 2): Add support for springboot v2
2 parents 56da26a + 4c1d1b3 commit b6a4b1d

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

Diff for: .github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- 'CODEOWNERS'
1010
- '**.md'
1111
- '.**'
12+
workflow_dispatch:
1213

1314
jobs:
1415
release:

Diff for: Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM eclipse-temurin:17-jre@sha256:0adcf8486107fbd706de4b4fdde64c2d2e3ead4c689b2fb7ae4947010e1f00b4
22

3-
RUN addgroup spring
4-
RUN useradd -g spring spring
3+
RUN addgroup spring && useradd -g spring spring
54
USER spring:spring
65

76
# https://github.com/microsoft/ApplicationInsights-Java/releases
8-
ADD --chown=spring:spring https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.19/applicationinsights-agent-3.4.19.jar /applicationinsights-agent.jar
7+
ADD --chown=spring:spring https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.6.0/applicationinsights-agent-3.6.0.jar /applicationinsights-agent.jar
8+
99
COPY --chown=spring:spring docker/applicationinsights.json ./applicationinsights.json
1010

1111
EXPOSE 8080

Diff for: docker/applicationinsights.json

+13
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,18 @@
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+
{
14+
"telemetryType": "request",
15+
"percentage": 100
16+
}
17+
]
518
}
619
}

Diff for: docker/run.sh

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

3-
exec java -javaagent:/applicationinsights-agent.jar ${JAVA_OPTS} org.springframework.boot.loader.launch.JarLauncher "$@"
3+
spring_boot_version=$(cat ./META-INF/MANIFEST.MF | grep 'Spring-Boot-Version:' | cut -d ' ' -f 2)
4+
major_version=$(echo "$spring_boot_version" | cut -d '.' -f 1)
5+
6+
# Check if the major_version is 3
7+
if [ "$major_version" -eq "3" ] ; then
8+
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)