跳到主要内容

Skywalking trace

Configuration

Example: configs/config_trace_skywalking.json

{
"tracing": {
"enable": true,
"driver": "SkyWalking",
"config": {
"reporter": "gRPC",
"backend_service": "127.0.0.1:11800",
"service_name": "layotto"
}
}
}
FieldRequired fieldsDescription
reporterYReporting method grpc
backend_serviceYskywalking oap server address
service_nameYService Name

Run skywalking

docker-compose -f diagnostics/skywalking/skywalking-docker-compose.yaml up -d

Run layotto

with Docker

You can run Layotto with docker

docker run -d \
-v "$(pwd)/configs/config_trace_skywalking.json:/runtime/configs/config.json" \
-p 34904:34904 --network=skywalking_default --name layotto \
layotto/layotto start

Compile locally (not for Windows)

You can compile and run Layotto locally.

[!TIP|label: Not for Windows users] Layotto fails to compile under Windows. Windows users are recommended to deploy using docker

cd ${project_path}/cmd/layotto_multiple_api/

Build it:

go build -o layotto

Run it:

./layotto start -c ../../configs/config_trace_skywalking.json

Run Demo

 cd ${project_path}/demo/flowcontrol/

Build the demo client:

 go build -o client

Run the demo client:

 ./client

Access http://127.0.0.1:8080

Release resources

If you run Layotto with docker, remember to shut it down:

docker rm -f layotto

Shutdown skywalking:

cd ${project_path}/diagnostics/skywalking

docker-compose -f skywalking-docker-compose.yaml down