add OpenTelemetry
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
@@ -14,6 +14,8 @@ COPY --chown=app ./gradle/ ./gradle
|
|||||||
COPY --chown=app ./gradlew ./build.gradle ./settings.gradle ./app.json ./
|
COPY --chown=app ./gradlew ./build.gradle ./settings.gradle ./app.json ./
|
||||||
COPY --chown=app ./src ./src
|
COPY --chown=app ./src ./src
|
||||||
|
|
||||||
|
RUN curl -OL https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
|
||||||
|
|
||||||
# Build the production package
|
# Build the production package
|
||||||
RUN ./gradlew clean build -x test
|
RUN ./gradlew clean build -x test
|
||||||
|
|
||||||
@@ -24,6 +26,11 @@ RUN useradd -m app
|
|||||||
USER app
|
USER app
|
||||||
|
|
||||||
COPY --chown=app --from=build /usr/src/app/build/libs/*-SNAPSHOT.jar /usr/app/edge.jar
|
COPY --chown=app --from=build /usr/src/app/build/libs/*-SNAPSHOT.jar /usr/app/edge.jar
|
||||||
|
COPY --chown=app --from=build /usr/src/app/opentelemetry-javaagent.jar /usr/app/opentelemetry-javaagent.jar
|
||||||
|
|
||||||
|
ENV JAVA_TOOL_OPTIONS="-javaagent:/usr/app/opentelemetry-javaagent.jar"
|
||||||
|
ENV OTEL_SERVICE_NAME="edge-service"
|
||||||
|
ENV OTEL_EXPORTER_OTLP_ENDPOINT="http://opentelemetry-collector.web:4318"
|
||||||
|
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:5000/actuator/health/liveness || exit 1
|
HEALTHCHECK CMD curl --fail http://localhost:5000/actuator/health/liveness || exit 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user