Clone the repo
Navigate to the system directory and run Maven with the package
goal. This will copy the OpenTelemetry Java Agent in to your server config:
cd system
mvn package
Start the server:
mvn liberty:run
Without changes, the java agent will be collecting and exporting them to zipkin. You can change the service names and exporters etc... in the jvm.options
files:
Navigate to the system endpoint:
localhost:9080/system/properties
In a spearate terminal, navigate to the inventory directory and start the server
cd inventory
mvn liberty:run
Traces are collected with automatic instrumentation.
Navigate to the inventory endpoint:
localhost:9081/inventory/systems/localhost
You should see the automatically created spans in the exporter endpoint.
Manual instrumentation will be enabled if you uncomment the following:
- InventoryResource class imports
- InventoryResource Tracer injection
- InventoryResource Span creation
- InventoryResource end Span
- InventoryManager class import
- InventoryManager WithSpan annotation
- InventoryManager WithSpan annotation
Navigate to the inventory endpoint:
localhost:9081/inventory/systems/localhost
You should see the manually created spans in the exporter endpoint.