在Jaeger上无法运行Istio分布式跟踪 [英] Istio distributed tracing with Jaeger not working

查看:452
本文介绍了在Jaeger上无法运行Istio分布式跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在安装了istiominikube上设置本地k8s集群,但是在使用Jaeger启用分布式跟踪时遇到了问题. 我有3个微服务A -> B -> C.我正在传播所需的所有标头:

I'm trying to set up a local k8s cluster and on minikube with installed istio and I have an issue with enabling distributed tracing with Jaeger. I have 3 microservices A -> B -> C. I am propagating the all the headers that are needed:

{"x-request-id", "x-b3-traceid", "x-b3-spanid", "x-b3-parentspanid", "x-b3-sampled", "x-b3-flags", "x-ot-span-context"}

但是在Jaeger界面上,我只能看到对服务A的请求,而看不到去往服务B的请求.

But on Jaeger interface, I can only see the request to the service A and I cannot see the request going to service B.

我已经记录了请求中发送的标头. 服务A的标题:

I have logged the headers that are sent in the request. Headers from service A:

Header - x-request-id: c2804368-2ff0-9d90-a2aa-972537968924
Header - x-b3-traceid: 3a2400b40bbe5ed8
Header - x-b3-spanid: 3a2400b40bbe5ed8
Header - x-b3-parentspanid: 
Header - x-b3-sampled: 1
Header - x-b3-flags: 
Header - x-ot-span-context: 

服务B的标题:

Header - x-request-id: c2804368-2ff0-9d90-a2aa-972537968924
Header - x-b3-traceid: 3a2400b40bbe5ed8
Header - x-b3-spanid: 3a2400b40bbe5ed8
Header - x-b3-parentspanid:
Header - x-b3-sampled: 1
Header - x-b3-flags:
Header - x-ot-span-context:

因此x-request-idx-b3-traceidx-b3-sampledx-b3-spanid数学.有一些未设置的标头. 另外,我正在通过类型为LoadBalancer的k8s服务IP(而不是通过入口)访问服务A.不知道这可能是问题所在.

So the x-request-id, x-b3-traceid, x-b3-sampled, and x-b3-spanid mathces. There are some headers that aren't set. Also, I'm accessing service A via k8s Service IP of type LoadBalancer, not via ingress. Don't know if this could be the issue.

UPD:我已经设置了istio网关,所以现在我可以通过istio网关访问服务A.但是结果是一样的,我可以看到gateway->A的跟踪,但没有任何进一步的跟踪

UPD: I have setup istio gateway so now I'm accessing service A via istio gateway. However the result is the same, I can see the trace for gateway->A but no any further tracing

推荐答案

如果查询了不存在的标头,则某些Web框架会返回空字符串.我已经在Spring Boot和KoaJS中看到了这一点.

Some web frameworks return empty string if a non-existent header is queried. I have seen this in Spring Boot and KoaJS.

如果Istio没有发送任何跟踪标头,则此标头逻辑使我们为不存在的那些中断跟踪的标头发送空字符串.

If any of the tracing headers is not sent by Istio, this header logic causes us to send empty string for those non-existent headers which breaks tracing.

我的建议是在获取标头的值之后,将标头中包含空字符串的标头过滤掉,并推广其余标头.

My suggestion is after getting the values for headers filter out the ones with empty string as their values and propogate the remaining ones.

这篇关于在Jaeger上无法运行Istio分布式跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆