Spring BootJaegerTracing
3servicefoo-svc``bar-svc``loo-svc
docker-compose up
curl http://localhost:8080
RedisTracing
opentracing java-spring-jaegerspring-data-redis
Auto Configurationopentracing java-redis-client
BeanPostProcessor
instrumentRedisConnectionFactoryBeanPostProcessor.java
@Component
public class RedisConnectionFactoryBeanPostProcessor implements BeanPostProcessor {
private Tracer tracer;
public RedisConnectionFactoryBeanPostProcessor(Tracer tracer) {
this.tracer = tracer;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof RedisConnectionFactory) {
return new TracingRedisConnectionFactory((RedisConnectionFactory) bean, false, tracer);
}
return bean;
}
}
opentracing java-redis-clientRedisConnection``ReactiveRedisConnection
tracing
ReactiveRedisConnection
tracingopentracing java-redis-client0.0.8
docker-compose down
istio-system``jaeger-query
Servicek8s
06-foo-ingress.yaml``<hostname>
k8s``kubectl apply -f .
foo-svc
curl http://ingress-test.<hostname>/sb-jaeger-tracing-demo/
curl http://istio-test.<hostname>/sb-jaeger-tracing-demo/
jaeger-query
nginx ingresstracingIssue #7963Istio Gatewaytracing
tracingistiocomponenttracingtracing istioenvoy sidecar
01-namespace.yaml``JAEGER_UDP_SENDER_HOST: jaeger-agent.istio-system.svc.cluster.local
istiojaeger-agentcluster DNS name
k8s``kubectl delete -f .
Environment Variable | Default Value | Belong Service | Description |
---|---|---|---|
BAR_SVC_URL |
http://bar-svc:8080 |
foo-svc |
|
LOO_SVC_URL |
http://loo-svc:8080 |
bar-svc |
|
SERVER_PORT |
8080 |
all | |
REDIS_HOST |
redis |
bar-svc loo-svc
|
|
REDIS_PORT |
6379 |
bar-svc loo-svc
|
|
JAEGER_UDP_SENDER_HOST |
localhost |
all | |
OPENTRACING_SPRING_WEB_ENABLED |
true |
all | spring webopentracing |
Jaegertracing