-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
支持上报数据到Jaeger #445
base: master
Are you sure you want to change the base?
支持上报数据到Jaeger #445
Conversation
Hi @chenzhao11, welcome to SOFAStack community, Please sign Contributor License Agreement! After you signed CLA, we will automatically sync the status of this pull request in 3 minutes. |
Hi @chenzhao11, welcome to SOFAStack community, Please sign Contributor License Agreement! After you signed CLA, we will automatically sync the status of this pull request in 3 minutes. |
...er-plugin/src/main/java/com/alipay/sofa/tracer/plugins/jaeger/adapter/JaegerSpanAdapter.java
Outdated
Show resolved
Hide resolved
...er-plugin/src/main/java/com/alipay/sofa/tracer/plugins/jaeger/adapter/JaegerSpanAdapter.java
Outdated
Show resolved
Hide resolved
...er-plugin/src/main/java/com/alipay/sofa/tracer/plugins/jaeger/adapter/JaegerSpanAdapter.java
Outdated
Show resolved
Hide resolved
...tracer-jaeger-plugin/src/main/java/com/alipay/sofa/tracer/plugins/jaeger/utils/NetUtils.java
Outdated
Show resolved
Hide resolved
修改之前使用Http上传Zipkin JSONV2格式的数据部分,改为使用Jaeger中的HttpSender上报Jaeger.thrift格式的数据到Jaeger Collector中 修改后的配置项如下:
|
Motivation:
支持上报span数据到Jaeger中进行展示
Modification:
1. 使用http方式发送zipkinV2 JSON格式的数据到Jaeger Collector中
Jaeger本身支持zipkinV2 JSON格式,所以新增配置类
JaegerSofaTracerAutoConfiguration
解析配置文件属性com.alipay.sofa.tracer.jaeger.baseUrl
,com.alipay.sofa.tracer.jaeger.enabled
,com.alipay.sofa.tracer.jaeger.gzipped
替换sofatrace的对应配置项,其余实现不变即可。2. 支持使用UDP发送Jaeger.thrift格式的数据到Jaeger Agent中,相关数据由Agent发送至Jaeger Collector
Agent是Jaeger中的重要模块,可以实现流量控制等功能,但是Agent只支持通过UDP发送的Thrift格式的数据,所以实现这个功能很有必要。
使用了
jaeger-client:1.6.0
中的相关方法实现,使用其中的UdpSender发送span数据,工作主要是将SOFATracerSpan转换为JaegerSpan。新增配置类JaegerAgentSofaTracerAutoConfiguration
。主要配置项:
com.alipay.sofa.tracer.jaeger.agent.host
com.alipay.sofa.tracer.jaeger.agent.port
com.alipay.sofa.tracer.jaeger.agent.enable
com.alipay.sofa.tracer.jaeger.agent.maxPacketSize
com.alipay.sofa.tracer.jaeger.agent.flushInterval
com.alipay.sofa.tracer.jaeger.agent.maxQueueSize
com.alipay.sofa.tracer.jaeger.agent.closeEnqueueTimeout
Result:
Fixes #372 .