Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/247/247 appinsights #23

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions launcher/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ FROM openjdk:17-slim-buster

# Optional JVM arguments, such as memory settings
ARG JVM_ARGS=""
ARG APPINSIGHTS_AGENT_VERSION=3.2.11

# Install curl, then delete apt indexes to save image space
RUN apt update \
&& apt install -y curl \
&& rm -rf /var/cache/apt/archives /var/lib/apt/lists

WORKDIR /app

RUN curl --fail -LO https://github.com/microsoft/ApplicationInsights-Java/releases/download/$APPINSIGHTS_AGENT_VERSION/applicationinsights-agent-$APPINSIGHTS_AGENT_VERSION.jar

COPY ./build/libs/app.jar /app
COPY ./src/main/resources/logging.properties /app

EXPOSE 8182

Expand All @@ -21,7 +26,8 @@ ENV WEB_HTTP_PORT="8181"
ENV WEB_HTTP_PATH="/api"

# Use "exec" for graceful termination (SIGINT) to reach JVM.
# ARG can not be used in ENTRYPOINT so storing value in an ENV variable
ENV ENV_JVM_ARGS=$JVM_ARGS
# ARG can not be used in ENTRYPOINT so storing values in ENV variables
ENV JVM_ARGS=$JVM_ARGS
ENV APPINSIGHTS_AGENT_VERSION=$APPINSIGHTS_AGENT_VERSION
ENTRYPOINT [ "sh", "-c", \
"exec java ${ENV_JVM_ARGS} -jar app.jar"]
"exec java -javaagent:applicationinsights-agent-$APPINSIGHTS_AGENT_VERSION.jar -Djava.util.logging.config.file=/app/logging.properties $JVM_ARGS -jar app.jar"]
3 changes: 3 additions & 0 deletions launcher/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ dependencies {
implementation("${edcGroup}:observability-api:${edcVersion}")
implementation("${edcGroup}:filesystem-configuration:${edcVersion}")

// JDK Logger
implementation("${edcGroup}:jdk-logger-monitor:${edcVersion}")

// To use FileSystem vault e.g. -DuseFsVault="true".Only for non-production usages.
val useFsVault: Boolean = System.getProperty("useFsVault", "false").toBoolean()
if (useFsVault) {
Expand Down
7 changes: 7 additions & 0 deletions launcher/src/main/resources/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
handlers = java.util.logging.ConsoleHandler
.level = INFO
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format = %1$tF %1$tT %4$s : %5$s %n
org.eclipse.dataspaceconnector.level = FINE
org.eclipse.dataspaceconnector.handler = java.util.logging.ConsoleHandler