Build tool observability. Demo of the OpenTelemetry integration for Gradle and Quarkus
APACHE-2.0 License
Demonstrates using Gradle Quarkus Plugin for building a Quarkus a web application with Gradle Build Tool, with the WireMock dev service being used for development purposes. Everything is connected to OpenTelemetry and exposes data there.
Components:
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
The most recent version is here: https://speakerdeck.com/onenashev/java-cicd-observability
I took Honeycomb for the GitHub Actions demo. You can fork the repository and do minimum reconfiguration to reproduce it on your instance.
SPAN_ID=abc5 TRACE_ID=cda5 OTEL_ENDPOINT=https://api.honeycomb.io OTEL_ENDPOINT_GRPC=api.honeycomb.io:443 OTEL_API_TOKEN_HEADER=x-honeycomb-team OTEL_API_TOKEN=${YOUR_TOKEN} OTEL_SERVICE_NAME=test ./gradlew build
We will use jaegertracing/all-in-one
for the demo
./run-otel.sh
SPAN_ID=abc5 TRACE_ID=cda5 ./gradlew build
Use clean
, test
, or any other Gradle Build Tool's feature to alter the behavior.
You can run your application in dev mode that enables live coding using:
quarkus dev
Or:
SPAN_ID=abc5 TRACE_ID=cda5 ./gradlew --console=plain quarkusDev
NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at
http://localhost:8080/q/dev/
.
The application can be packaged using:
./gradlew quarkusBuild
It produces the quarkus-run.jar
file in the build/quarkus-app/
directory.
Be aware that it’s not an über-jar as the dependencies are copied into the build/quarkus-app/lib/
directory.
The application is now runnable using java -jar build/quarkus-app/quarkus-run.jar
.