This laboratory demonstrates the key aspects of Jaeger and OpenTelemetry, both monitoring tools for applications. It was created for Instruct's 2023 Summit X-DevOps presentation.
The slides with the presentation can be found at:
https://docs.google.com/presentation/d/1edvxXQUpAjwI070CLqF9Hkv7Srj3DJCPqM6qoUkFgog/edit?usp=sharing
-
Copy the content of
calculator-api/.env.sample
to a new filecalculator-api/.env
, and the content ofblackjack-api/.env.sample
to a new fileblackjack-api/.env
. -
Start the docker containers
docker-compose up -d --build
The command starts the:
- Jaeger all-in-one service. The UI is at http://localhost:16686/.
- PostgreSQL database.
- Blackjack API service at http://localhost:8001/api/blackjack/.
- Calculator API service at http://localhost:8002/api/calculator/.
-
Go to the Jaeger UI and search for traces on the
blackjack-api
service. The will already be traces related to the start of the service. -
Make a get request to start a game of blackjack:
$ curl http://localhost:8001/api/blackjack/deal/
-
Go back to the Jaeger UI, search again for traces on the
blackjack-api
service, and click on the most recent trace with the addressapi/blackjack/deal/$
. -
On the tab
Service & Operation
, select theblackjack-api api/blackjack/deal/$
span and open it'sTags
tab. Look for theoperation.*
tags. Those were set on code to provide more context on the request. -
Open the
blackjack-api SELECT
and open it'sTags
tab. Look for thedb.statement
tag. It should show the query made on the database. -
Look for the
calculator-api api/calculator/sum/$
span. It should have a different color, indicating it's from a diferent system. Open the span'sTags
tab and look for theoperation.*
tags. They were also set on code, similarly as before. -
Now make a get request to force an exception:
$ curl http://localhost:8001/api/blackjack/cheat/
-
Go back to the Jaeger UI, search again for traces on the
blackjack-api
service, and click on the most recent trace with the addressapi/blackjack/cheat/$
. -
On the tab
Service & Operation
, select theblackjack-api api/blackjack/deal/$
span and open it'sLog(s)
tab. Open the first log and you will see the details of the exception. -
Finally, on the navigation menu on top of the screen, select the
System Architecture
option. You can see how the services relate to each other, as well as how many traces are between them. (It is easier to see on theDAG
tab).