Comments (13)
zipkin接收端的 SkyWalking 日志报错,因为在取duration属性时取到了空指针;
@jjtyro 你好,具体是如何使用 SkyWalking 的哈。
from sofa-tracer.
在尝试SkyWalking的zipkin receiver,这个问题与后面是不是SkyWalking没有关系。
from sofa-tracer.
@jjtyro 好的。我来看下,之后给你同步结论。
from sofa-tracer.
@guanchao-yang Ok!
from sofa-tracer.
@jjtyro 非常抱歉,虽然按照你的方法,我还是没有能够复现出的场景。通过部署的 Zipkin 服务端,随机选择几个上报的 Span,类似如下图所示:
然后,选择汇报的数据格式即 json,会有类似如下的显示:
[
{
"traceId": "003660e8adb90f84",
"id": "af63ad4c86019caf",
"name": "http://127.0.0.1:8080/zipkin",
"timestamp": 1530620120564000,
"duration": 1000,
"annotations": [
{
"timestamp": 1530620120564000,
"value": "sr",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
},
{
"timestamp": 1530620120565000,
"value": "ss",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
}
],
"binaryAnnotations": [
{
"key": "current.thread.name",
"value": "http-nio-8080-exec-3",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
},
{
"key": "local.app",
"value": "SOFATracerReportZipkin",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
},
{
"key": "method",
"value": "GET",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
},
{
"key": "req.size.bytes",
"value": "-1",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
},
{
"key": "request.url",
"value": "http://127.0.0.1:8080/zipkin",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
},
{
"key": "resp.size.bytes",
"value": "51",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
},
{
"key": "result.code",
"value": "200",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
},
{
"key": "span.kind",
"value": "server",
"endpoint": {
"serviceName": "http://127.0.0.1:8080/zipkin",
"ipv4": "10.15.233.42"
}
}
]
}
]
发现其 duration
属性值是都存在的 "duration": 1000,
,同时我们的 OpenTracing Span 到 zipkin.Span 的模型转化代码位置在:com.alipay.sofa.tracer.boot.zipkin.ZipkinSofaTracerSpanRemoteReporter#convertToZipkinSpan
具体的代码为:
// Zipkin is in nanosecond
zipkinSpanBuilder.duration((sofaTracerSpan.getEndTime() - sofaTracerSpan.getStartTime()) * 1000);
- @jjtyro 你可以尝试将断点等打在这里,看下是不是真的缺失哈。如果是,麻烦在明确给我下复现方法哈,第一时间帮你解决,抱歉哈。
from sofa-tracer.
我这边是出现这种状况的,环境:
- Sofa-tracer sample是跑在本地笔记本上,Skywalking是在远端服务器上
- json包内容是通过wireshark截取tcp报文得到,不是在APM端界面导出
- 笔记本环境是Ubuntu 16.04、Oracle jdk 1.8.0_171
- sample代码在Idea IDE时run起来
每次通过上述shell脚本发送请求,都会产生这种效果。我更新下Sofa-tracer的代码,在你说的地方加日志,再看看。
from sofa-tracer.
@jjtyro 好的,有问题第一时间反馈到我哈。
from sofa-tracer.
@guanchao-yang 通过加日志确认了,如果耗时是0, 即sofaTracerSpan.getEndTime()、sofaTracerSpan.getStartTime()值相等时,zipkin的Builder最终不会输出duration.
zipkin.Span.Builder:
public Span.Builder duration(@Nullable Long duration) {
this.duration = duration != null && duration == 0L ? null : duration;
return this;
}
zipkin.Span.toString 最后会调用到zipkin.internal.write(),里面有:
if (value.duration != null) {
b.writeAscii(",\"duration\":").writeAscii(value.duration);
}
Ok, 应该不是sofa的问题,接收端在某些运算处理时没对这种情况做判断。
谢谢!
from sofa-tracer.
@jjtyro 👍赞
from sofa-tracer.
为什么sofa-tracer取毫秒级做stratTime与endTime,而不是直接取微秒级? 一次处理在毫秒内完成是完全可能的。
from sofa-tracer.
@jjtyro 是可以取 微秒级
的,这个点可以作为我们 Feature 的一个增强,不知道你能否参与贡献进来哈。可以直接给我们 PR 哈。
from sofa-tracer.
@guanchao-yang I am trying....
from sofa-tracer.
@jjtyro Good Job!!!!
from sofa-tracer.
Related Issues (20)
- OpenFeign 10.7.3+版本兼容问题 HOT 1
- 不使用sofa boot,使用spring boot parent,依赖tracer-sofa-boot-starter时启动报错 HOT 6
- does support dubbo async invoke??? HOT 1
- Redis plugin未恢复paren span,导致span id的层级无限增长
- Open Source Promotion Plan 2022 - upgrade opentracing api version & adapter opentelemetry api HOT 5
- SofaTracer如何支持Agent接入方式 HOT 2
- spring cloud 3中的openfeign支持 HOT 2
- spring cloud gateway webflux集成问题 HOT 1
- 基于SOFAArk实现类加载器加载外置的SofaTracer的Spring Boot Starter插件 HOT 4
- datasource 模块如何记录完整的 sql 语句,包含参数的那种
- sofatracer的tracerId不一定为30位 HOT 1
- sofa-tracer-httpclient-plugin使用httpclient连接池,请求发生异常时,内存泄漏,spanId无限变长 HOT 19
- sofa-tracer-kafkamq-plugin支持ProducerListener解决方案 HOT 1
- CI failed in the master branch
- classNotFound SofaTracerLoadBalancedFeignClient HOT 1
- 是否支持 SOFA-TraceId 由前端生成放到header中请求
- sofa-tracer redis plugin未串联父span
- dubbo 2.7 使用问题 HOT 1
- feat: Delegate java.util.concurrent.Executor
- springboot v3 版本 启动报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sofa-tracer.