chuan-yun / Molten

php probe for zipkin and opentracing
Apache License 2.0
792 stars 160 forks source link

构建的JSON Span内容是否考虑做下兼容? #72

Closed googlerobot closed 6 years ago

googlerobot commented 6 years ago
2018-03-08 03:51:36.823  WARN 5 --- [nio-9411-exec-8] zipkin.server.ZipkinHttpCollector        : 
Cannot decode spans due to IllegalArgumentException(Expected value to be a boolean, string or number 
but was NULL at path $[2].binaryAnnotations[2].value reading List<Span> from json: 

查看对应的binaryAnnotations 确实是value 是null

"key": "http.response",
"value": null,
"endpoint": {
"serviceName": "xxxx",
"ipv4": "xxxx",
"port": 80
}
}

另外有部分zipkin的日志是这种

 java.lang.IllegalArgumentException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ reading List<Span> from json: {"error":[]}

找了下以前的issue似乎也有类似的问题,这种情况是不是可以考虑忽略下?

zefengguo commented 6 years ago

如下debug级别的提示信息,会影响zipkin正常使用么? java.lang.IllegalArgumentException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ reading List from json

googlerobot commented 6 years ago

这个其实不影响使用,另外一个error的对应数据其实没采集成功吧。

silkcutKs commented 6 years ago

@googlerobot

 java.lang.IllegalArgumentException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ reading List<Span> from json: {"error":[]}

error的那个是开启了err log的收集, 我添加一个选项将其关闭 好了之后,我在这个issue告知,

2018-03-08 03:51:36.823  WARN 5 --- [nio-9411-exec-8] zipkin.server.ZipkinHttpCollector        : 
Cannot decode spans due to IllegalArgumentException(Expected value to be a boolean, string or number 
but was NULL at path $[2].binaryAnnotations[2].value reading List<Span> from json:

这个应该是response返回为空的问题, 这个我作一下兼容吧。

silkcutKs commented 6 years ago

@googlerobot
response 返回空是在哪个版本,请求什么url下出现的?

googlerobot commented 6 years ago

@silkcutKs php 5.6.4 molten 版本 0.1.2beta

请求的 URL 是一个内部服务的地址,返回的 HTTP 状态码也都是200,没发现其他异常。。

markWord commented 6 years ago

@silkcutKs java.lang.IllegalArgumentException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $ reading List<Span> from json: {"error":[]} 请问这个问题目前项目已经有设置了error log的收集开关了吗?

kcloze commented 6 years ago

同样遇到这样的问题

silkcutKs commented 6 years ago

@markWord @kcloze 已经设置了关闭report 的开关, open_report 1 是开启, 0是关闭, 默认关闭。

silkcutKs commented 6 years ago

resolved