.
├── app/ <-- golang app, restful api with `aws-xray-sdk-go`
├── xray/ <-- xray Dockerfile, localhost log
├── docker-compose.yml <-- localhost build Sample Applications
├── Makefile <-- docker push app/xray to ECR
└── cfn.yml <-- AWS CloudFormation Template
- Local AWS Credential
- first run
- cd xray && docker build -t xray-daemon .
- demo
- 確定 account_id && region,
make show
docker-compose up
cd ./app/utility/ && go test -run gorm_test.go
make test
- 確定 account_id && region,
- go to aws xray service to see the information (wait 1 min)
- go to ECR and create three repositories
- xray-app
- xray-mariadb
- aws-xray-daemon
- edit Makefile, to update the below args
- AWS_ACCOUNT_ID
- AWS_REGION
- push image to ECR
make app
make xray
make mysql
- go to AWS CloudFormation and build stack with
cfn.yml
- go to ECS console and get Task public IP,
curl $IP
and then check XRAY console
- Localhost test, use
make test
to execute below command server=localhost
curl $server:9001
curl $server:9001/ping
目前 xray 使用
xray.SQLContext
, 不支援 gorm, 只能用繞路的方式. 且, xray-console 的 map 無法顯示 database 的 node.
curl -X POST $server:9001/new
curl -X GET $server:9001/all
curl -X DELETE $server:9001/del -d '{"id":1}'
curl -X GET $server:9001/sql/by/xray/success
curl -X GET $server:9001/sql/by/xray/error
curl -X GET $server:9001/error/400
curl -X GET $server:9001/error/429
curl -X GET $server:9001/error/500
curl -X GET $server:9001/error/panic
curl -X PATCH $server:9001/many/funcs
curl -X PATCH $server:9001/send/sqs