Jaeger, inspired by Dapper and OpenZipkin, is a distributed tracing system released as open source by Uber Technologies. It is used for monitoring and troubleshooting microservices-based distributed systems, including:
- Distributed context propagation
- Distributed transaction monitoring
- Root cause analysis
- Service dependency analysis
- Performance / latency optimization
Jaeger can be used with various storage backends. YugabyteDB's YCQL API can also be used as a storage backend for Jaeger (version 1.43.0, previous versions are unsupported).
The Jaeger example on this page uses the HotROD sample application to illustrate the use of YCQL as a storage backend.
Additionally, it uses Jaeger All-in-one, which is a special distribution that combines three Jaeger components, agent, collector, and query service/UI, in a single binary or container image.
NoteThe following example is for testing purposes only. For production deployment, refer to the Jaeger documentation.
To use Jaeger, ensure that you have the following:
YugabyteDB up and running. Download and install YugabyteDB by following the steps in Quick start.
Build the application
To build the application, do the following:
Jaeger natively supports two databases, Cassandra and Elasticsearch. So you need to set an environment variable
SPAN_STORAGE_TYPEto specify your choice of database. For YCQL examples, set it to
Clone the Jaeger repository.
git clone firstname.lastname@example.org:jaegertracing/jaeger.git && cd jaeger
Initialize the cassandra keyspace and create the schema on YCQL using ycqlsh shell as follows:
MODE=test sh ./plugin/storage/cassandra/schema/create.sh | path/to/ycqlsh
Verify that a keyspace
jaeger_v1_testis created using ycqlsh as follows:
ycqlsh> desc keyspaces;
system_auth jaeger_v1_test system_schema system
From the Jaeger project home directory, add the
jaeger-uisubmodule as follows:
git submodule update --init --recursive
Compile, package the UI assets in the
jaeger-uisource code, and run Jaeger All-in-one using the following command:
Wait for the logs to settle, then navigate to http://localhost:16686 to access the Jaeger UI, where you can view the traces created by the application. This indicates that the Jaeger UI, collector, query, and agent are running.
Run the application
To run the application, do the following:
From a new terminal, set the
SPAN_STORAGE_TYPEenvironment variable again as follows:
From your Jaeger project's home directory, start the HotROD application as follows:
go run ./examples/hotrod/main.go all
Verify the integration
To verify the integration, navigate to the HotROD landing page and click a few options on the page to verify if you get a response about a driver arriving in a few minutes. This triggers a few traces which are in turn stored in the YCQL backend storage. You can view the traces in the Jaeger UI at http://localhost:16686.
You can also verify the integration from your ycqlsh shell using the following commands:
```sql use jaeger_v1_test; select * from jaeger_v1_test.traces; ``` All the traces created by the HotROD application are stored in the traces table.