opentracing
小于 1 分钟
opentracing
- 什么是opentracing
- 什么是jaeger
- 如何实现服务可观测
启动jaeger
docker run -d -p 5775:5775/udp -p 16686:16686 jaegertracing/all-in-one:latest
如何注入trace到Gin
1. 在路由中间件StartSpan并且gin.Context.Set将parentSpan.Context往下传递
2. GRPC的client的Dial的时候注入unaryTraceInterceptor(带上全局的tracer)拦截请求的时候start child span
tips: 关于UnaryClientInterceptor的invoke,相当于middlware.next
UnaryInvoker is called by UnaryClientInterceptor to complete RPCs
命令模式关键字
相关地址
github.com/yurishkuro/opentracing-tutorial/
[opentracing.io/docs/getting-started/][https://opentracing.io/docs/getting-started/]
https://www.cnblogs.com/whuanle/p/14598049.html