This sample shows the Temporal Java SDK OpenTracing support. It shows how to set up OpenTracing, as well as OpenTelemetry. The sample uses the CNCF Jaeger distributed tracing platform.
Note, it is assumed that you have Temporal Server set up and running using Docker Compose. For more information on how to do this see the main readme.
- Start Jaeger via Docker:
docker run -d -p 5775:5775/udp -p 14250:14250 -p 16686:16686 -p 14268:14268 jaegertracing/all-in-one:latestThis starts Jaeger with udp port 5775 and grpc port 14250. Note that if these ports are different in your setup to reflect the changes in JagerUtils.
- Start the Worker:
- For OpenTelemetry:
./gradlew -q execute -PmainClass=io.temporal.samples.opentracing.TracingWorker- For OpenTracing:
./gradlew -q execute -PmainClass=io.temporal.samples.opentracing.TracingWorker --args="OpenTracing"- Start the Starter
- For OpenTelemetry
./gradlew -q execute -PmainClass=io.temporal.samples.opentracing.Starter- For OpenTracing
./gradlew -q execute -PmainClass=io.temporal.samples.opentracing.Starter --args="OpenTracing"-
Go to your Jaeger UI on http://127.0.0.1:16686/search
-
In the "Service" section select either "temporal-sample-opentelemetry" or "temporal-sample-opentracing", depending on your starting options.
-
Check out the Operation dropdown to see all the different operations available
-
In the Tags search input you can tag a specific workflow id, for example:
workflowId=tracingWorkflow
- Click on "Find Traces" in the Jager UI and see all look at all the spans info