opentelemetry-gradle-quarkus-demo

Build tool observability. Demo of the OpenTelemetry integration for Gradle and Quarkus

APACHE-2.0 License

Stars
1
Committers
2

Demo: Build Tool Observability with OpenTelemetry, Gradle and Quarkus

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/ .

Slides

The most recent version is here: https://speakerdeck.com/onenashev/java-cicd-observability

GitHub Actions with Honeycomb

I took Honeycomb for the GitHub Actions demo. You can fork the repository and do minimum reconfiguration to reproduce it on your instance.

Manual test

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

Local Test

Starting OTel Collector

We will use jaegertracing/all-in-one for the demo

./run-otel.sh

Tracing the build process

 SPAN_ID=abc5 TRACE_ID=cda5 ./gradlew build

Use clean, test, or any other Gradle Build Tool's feature to alter the behavior.

Running the application in dev mode

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/.

Packaging and running the application

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.