Skip to content
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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

chenzhao11
Copy link

@chenzhao11 chenzhao11 commented Jul 19, 2021

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
主要配置项:

  • Agent IP地址 : com.alipay.sofa.tracer.jaeger.agent.host
  • Agent 接受Jaeger.thrift的端口:com.alipay.sofa.tracer.jaeger.agent.port
  • 是否发送到Agent:com.alipay.sofa.tracer.jaeger.agent.enable
  • UDP数据包的最大字节数:com.alipay.sofa.tracer.jaeger.agent.maxPacketSize
  • 向Command Queue中添加FlushCommand的时间间隔:com.alipay.sofa.tracer.jaeger.agent.flushInterval
  • Command Queue队列的最大容量:com.alipay.sofa.tracer.jaeger.agent.maxQueueSize
  • 将CloseCommand发送到Command Queue的最长等待时间:com.alipay.sofa.tracer.jaeger.agent.closeEnqueueTimeout

Result:

Fixes #372 .

@sofastack-bot
Copy link

sofastack-bot bot commented Jul 19, 2021

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.

@sofastack-bot
Copy link

sofastack-bot bot commented Jul 19, 2021

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.

@sofastack-bot sofastack-bot bot added cla:yes and removed cla:no labels Aug 2, 2021
@glmapper glmapper self-requested a review August 18, 2021 01:57
@chenzhao11
Copy link
Author

修改之前使用Http上传Zipkin JSONV2格式的数据部分,改为使用Jaeger中的HttpSender上报Jaeger.thrift格式的数据到Jaeger Collector中

修改后的配置项如下:

字段 备注
com.alipay.sofa.tracer.jaeger.enabled 是否启用Jaeger上报
com.alipay.sofa.tracer.jaeger.collector.baseUrl collector的地址
com.alipay.sofa.tracer.jaeger.collector.maxPacketSizeBytes 使用Http上传的数据包大小,默认2MB
com.alipay.sofa.tracer.jaeger.receiver 接受端是collector还是agent默认是collector
com.alipay.sofa.tracer.jaeger.agent.host agent的ip/hostname
com.alipay.sofa.tracer.jaeger.agent.port agent的port
com.alipay.sofa.tracer.jaeger.agent.maxPacketSizeBytes UDP数据包大小的最大值,默认65000
com.alipay.sofa.tracer.jaeger.flushInterval 向CommandQueue写FlushCommand的间隔
com.alipay.sofa.tracer.jaeger.maxQueueSize CommandQueue的最大长度
com.alipay.sofa.tracer.jaeger.closeEnqueueTimeout 向CommandQueue中写CloseCommand的最长等待时间

@chenzhao11 chenzhao11 requested a review from glmapper September 9, 2021 05:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

希望官方推荐使用Jaeger(Jaeger is better one )
2 participants