This repository contains an example on how to instrument a Spring Boot application, dockerized using Jib Maven Plugin, with Open Telemetry.
JDK: 17
OpenTelemetry Java Agent is download an installed in src/main/data/otel
folder.
Check the <configuration>
section in the jib-maven-plugin
plugin configuration:
<from>
<image>gcr.io/distroless/java17-debian11</image>
</from>
<container>
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
<jvmFlags>
<jvmFlag>-javaagent:/data/otel/opentelemetry-javaagent.jar</jvmFlag>
</jvmFlags>
</container>
<extraDirectories>
<paths>
<!-- Copies from 'src/main/data' into '/data' on the container -->
<path>
<from>src/main/data</from>
<into>/data</into>
</path>
</paths>
</extraDirectories>
For this project we use Signoz as monitoring tool.
$ git clone https://github.com/SigNoz/signoz; cd signoz/deploy
$ docker-compose -f docker/clickhouse-setup/docker-compose.yaml up
# open browser: localhost:3301, First account created - admin
# Go to project root
$ cd otel-jib
$ mvn compile jib:dockerBuild # local docker daemon
$ docker-compose -f deployment/docker-compose.yaml up
Some useful links: