Sending Demo Traces With the HotROD Application
Not ready to instrument and deploy components? We've got you covered with an app that can send demo traces to your Distributed Tracing.
Using the HotROD app is so easy, and fast, that you'll be searching for traces in Logz.io within a few minutes of setting up the app!
What's HotROD demo application?
HotROD (Rides on Demand) is a demo application, created by Logz.io, that consists of several microservices that send requests to each other. The application illustrates the use of the OpenTracing API. It can be run standalone, but requires a Jaeger backend to view the traces.
The HotROD (Rides on Demand) application generates a web page with four customer buttons to order a car to the customer's business to pick up passengers or merchandise for delivery to a desired location.
Clicking a button sends a request to the backend, which generates a trace. The app responds with the car license number and estimated time of arrival (ETA).
You have a web client ID in the upper left corner: A random session ID assigned by the Javascript UI. Each time you reload the page, it generates a new session ID.
In this example, the web client ID is 1465. All the ride requests generated in the session include this ID in a unique request ID. For each button click, you'll see the following information:
- Car license number
- Driver ETA
- Unique request ID, built from the session ID and a sequence number.
- Latency - how long the backend took to respond, as measured by the Javascript UI.
And once you open the Distributed Tracing tab, select a service, and Find Traces:
Set up HotROD demo traces
This topic explains how to set up the Logz.io HotROD sample application to send demo traces to your Distributed Tracing account.
During this process, you'll use a simple yaml configuration file to deploy the following components in a Docker environment:
- A modified HotROD sample application, based on the original project developed to demonstrate distributed tracing
- The Jaeger agent
- The Logz.io Jaeger collector
Prerequisites
To run the demo configuration and deploy the components, you must have the following software installed:
Update the .env file from the Logz.io tracing-demo repository
The .env file might be hidden.
Use a terminal to grab the repo code using the git command:
git clone https://github.com/logzio/tracing-demo.git
and change directories:cd tracing-demo
.Open the
.env
file and update the parameters with your preferred text editor.Enter your Distributed Tracing account token in the first line:
ACCOUNT_TOKEN=Enter your account token here
. You must have admin permissions for the Logz.io account to view the Manage tokens page. If you’re not an admin user for the account, consult with an account admin to get the Distributed Tracing token information.- From the Tracing or (Settings) menu, go to Manage tokens > Data shipping tokens > Tracing
- Find the Distributed Tracing account you want to ship to in the table, and copy the token.
Enter the correct 2-letter code for your region in the second line:
REGION_CODE=Enter your region code here
Look up the 2-letter code for your region in the Regions and Listener Hosts table.You can find the region code for your account in the General settings page, here >Settings > General**.
Save and close the updated .env file.
In the terminal, run
docker network create dockercompose_testcluster
to create a Docker network.
Updating the .env file in the Logz.io tracing demo repo with your tracing account token and region code
adds your jaeger-logzio-collector
definition parameters to the yaml file, in the environment
section.
Deploy the demo app
To run the demo:
- To start the HotROD demo app, in the terminal, run:
docker-compose up
. - To open the application, navigate to the main HotROD service at 127.0.0.1:18080.
- To send traces, click the buttons. You can view the logs in the foreground in the terminal.
- To stop the demo, run:
ctrl+c
. - To remove the docker container, run:
docker-compose down
.
Command summary
Command | Description |
---|---|
docker-compose up | Starts the demo app |
ctrl+c | Interrupts the demo process |
docker-compose down | Removes the demo container |
Viewing demo traces
After sending traces with the tracing demo app, navigate to the Distributed Tracing tab in Logz.io, select a service and click Find Traces to view your generated trace data.