.
├── 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 upcd ./app/utility/ && go test -run gorm_test.gomake 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 appmake xraymake mysql
- go to AWS CloudFormation and build stack with
cfn.yml - go to ECS console and get Task public IP,
curl $IPand then check XRAY console
- Localhost test, use
make testto execute below command server=localhost
curl $server:9001curl $server:9001/ping
目前 xray 使用
xray.SQLContext, 不支援 gorm, 只能用繞路的方式. 且, xray-console 的 map 無法顯示 database 的 node.
curl -X POST $server:9001/newcurl -X GET $server:9001/allcurl -X DELETE $server:9001/del -d '{"id":1}'
curl -X GET $server:9001/sql/by/xray/successcurl -X GET $server:9001/sql/by/xray/error
curl -X GET $server:9001/error/400curl -X GET $server:9001/error/429curl -X GET $server:9001/error/500curl -X GET $server:9001/error/panic
curl -X PATCH $server:9001/many/funcscurl -X PATCH $server:9001/send/sqs

