Jaeger trace
Configuration
Example:configs/config_trace_jaeger.json
{
"tracing": {
"enable": true,
"driver": "jaeger",
"config": {
"service_name": "layotto"
}
}
}
Fields | Required | Note |
---|---|---|
service_name | Y | Service Name |
agent_host | N | agent component port |
Strategy | N | Data reporting, default using collector method. Optional configuration values include collector and agent |
collector_endpoint | N | port number for collector, default http:///127.0.0.1:14268/api/traces |
Run Jaeger
cd ${project_path}/diagnostics/jaeger
docker-compose -f jaeger-docker-compose.yaml up -d
Run layotto
A layoto's server: can be started as follows.
Switch directory:
cd ${project_path}/cmd/layotto_multiple_api
Build:
go build -o layotto
Run:
./layotto start -c ../../configs/config_trace_jaeger.json
Run Demo
The corresponding call end code is inclient.go, which runs the Sayhello interface with layotto:
Switch directory:
cd ${project_path}/demo/flowcontrol/
Build:
go build -o customer
Run:
./client
Visit http://localhost:16686
Clean up resources
cd ${project_path}/diagnostics/jaeger
docker-compose -f jaeger-docker-compose.yaml down