GoLang实现基于Jaeger的分布式链路追踪
2023-09-27 14:25:41 时间
码字不易,转载请附原链,搬砖繁忙回复不及时见谅,技术交流请加QQ群:909211071
完整源码:https://github.com/why444216978/gin-api
jaeger下载地址:Jaeger – Download Jaeger
运行jaeger:
./jaeger-all-in-one
gin注册中间件:
https://github.com/why444216978/gin-api/blob/master/routers/router.go
log+jaeger中间件:
https://github.com/why444216978/gin-api/blob/master/middlewares/log/logger.go
HTTP注入:
https://github.com/why444216978/gin-api/blob/master/libraries/jaeger/http.go
https://github.com/why444216978/gin-api/blob/master/controllers/opentracing/opentracing.go
Gorm注入:
https://github.com/why444216978/gin-api/blob/master/libraries/jaeger/gorm.go
Redis注入:
https://github.com/why444216978/gin-api/blob/master/libraries/jaeger/redis.go
请求 /test/rpc 查看调用链路:http://localhost:16686/