VMware has ended active development of this project, this repository will no longer be updated.
This is a sample application using Spring Boot with Jersey called beachshirts, which makes shirts for the beach.
-
git clone
this repo and navigate to this dir:git clone https://github.com/wavefrontHQ/otel-demo-app-java cd otel-demo-app-java
-
Run
mvn clean install
from the root directory of the project. -
Using the following commands from the root directory, run all the services:
java -jar ./shopping/target/shopping-1.0-SNAPSHOT.jar java -jar ./styling/target/styling-1.0-SNAPSHOT.jar java -jar ./delivery/target/delivery-1.0-SNAPSHOT.jar
-
View the shopping menus:
curl http://localhost:50050/shop/menu
-
Order shirts using HTTP POST request:
curl http://localhost:50050/shop/order -d '{"styleName": "testStyle1", "quantity": 5}'
- You can use
./loadgen.sh [interval]
in the root directory to send a request ordering random shirts everyinterval
seconds (defaults to every 1 second)
- You can use
-
Download the OpenTelemetry Java Agent:
curl -Lo /tmp/opentelemetry-javaagent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
-
Run the services, attaching the agent:
JAVA_AGENT=/tmp/opentelemetry-javaagent.jar java -jar -javaagent:$JAVA_AGENT ./shopping/target/shopping-1.0-SNAPSHOT.jar java -jar -javaagent:$JAVA_AGENT ./styling/target/styling-1.0-SNAPSHOT.jar java -jar -javaagent:$JAVA_AGENT ./delivery/target/delivery-1.0-SNAPSHOT.jar
-
Run the OpenTelemetry Collector with the
tanzuobservability
exporter configured to point at your wavefront-proxy. -
Run the wavefront-proxy with a
token
andserver
pointing to your Tanzu Observability endpoint. -
Order some shirts and see traces appear in the Tanzu Observability UI.