This example contains two services (flights and passengers) with two different mysql instances (flights and passengers). Making any interactions with the API of any service will report it to jaeger.
Learn more about OpenTelemetry here
Use host port for curl requests from host machine
Name | Type | Host Port | Container port |
---|---|---|---|
jaeger | Jaeger:all-in-one | 6831/udp, 14269, 16686 | 6831/udp, 14269, 16686 |
flight-db | MySQL | 3306 | 3306 |
passenger-db | MySQL | 3307 | 3306 |
flight-service | Go service | 8080 | 8080 |
passenger-service | Go service | 8090 | 8080 |
Running this project requires docker and docker-compose version 1.29.2.
git clone https://github.com/Jepzter/jaeger-example.git
- Optional Choose in docker-compose if you want passenger-service to be unstable and simulate errors. Set environment UNSTABLE=true. Default is false
- Run
docker-compose up
in jaeger-example directory - Make a request defined in any of the apis below
- Navigate to to jaeger ui
- Select
flight-service
orpassenger-service
in theservices
dropdown menu - Click
Find traces
- Select a trace to view it's timeline
GET http://localhost:8080/api/flight-service/flight-v1/1
Parameter | Type | Description |
---|---|---|
Flight ID |
integer |
Required. The ID of the flight. Example contains only ID 1 and 2 |
{
"FlightID": 1,
"Name": "FLIGHT 33",
"Destination": "VXO",
"Passengers": [
{
"PassengerID": 1,
"FlightID": 1,
"Firstname": "Jesper",
"Surname": "Placeholdersson"
}
]
}
GET http://localhost:8090/api/passenger-service/passenger-v1?flightId=1
Parameter | Type | Description |
---|---|---|
FlightId |
integer |
Optional. The ID of the flight. Example contains only ID 1 and 2 |
[
{
"PassengerID": 1,
"FlightID": 1,
"Firstname": "Jesper",
"Surname": "Placeholdersson"
}
]