chuan-yun / Molten

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

trace spans信息会被截断 #67

Open goangular opened 6 years ago

goangular commented 6 years ago

文件输出的span json,zipkin格式下会从前面的信息截断到trace_id,opentracing格式下会从后面截断,json不完整,会不间断的会出现。不管是否做压测都会出现。会是写文件并发导致的吗? 配置信息: extension=molten.so molten.enable=1 molten.tracing_cli=1 molten.sampling_rate=1 molten.sink_type=1 molten.sink_log_path=/tmp/molten/

silkcutKs commented 6 years ago

@goangular 你把截断的文件贴一下把, 你是查看的原文件吗? 如果你中间使用了什么日志收集工具, 也可能会被截断。

goangular commented 6 years ago

@silkcutKs 是查看的原文件。

goangular commented 6 years ago

下面是zipkin截断:{"error":[]} a30de12e3fc21d24","name":"connect","version":"php-4","id":"e9b3443027a01de2","parentId":"f6c9c142eea0dd7b","timestamp":1517414442907822,"duration":3528,"annotations":[{"value":"cs","timestamp":1517414442907822,"endpoint":{"serviceName":"2","ipv4":"172.30.30.32","port":30002}},{"value":"cr","timestamp":1517414442911350,"endpoint":{"serviceName":"2","ipv4":"172.30.30.32","port":30002}}],"binaryAnnotations":[{。。。后面正常

goangular commented 6 years ago

a30de12e3fc21d24 是trace_id ,完整是:[{"trace_id":"a30de12e3fc21d24"

goangular commented 6 years ago

zipkin格式的 大部分trace_id 前缀丢失。少部分是其他丢失。1000条大概会出现100多条。测试并发量挺大

goangular commented 6 years ago

oepntracing 从db.statement后面截断:[{"operationName":"connect","startTime":1517910615357930,"finishTime":1517910615360870,"spanContext":{"traceID":"d598d61e53e0419d","spanID":"f0be56d62bcec310","parentSpanID":"293bda65e49a6100"},"tags":{"span.kind":"client","db.statement":"connect test-ad.codis.meiyoucloud.com,19000,3,","db.type":"redis"},"logs":[]},{"operationName":"get","startTime":1517910615360897,"finishTime":1517910615361416,"spanContext":{"traceID":"d598d61e53e0419d","spanID":"d4acf866942f5638","parentSpanID":"293bda65e49a6100"},"tags":{"span.kind":"client","db.statement":"get 3g_bgd_type,","db.type":"redis"},"logs":[]},{"operationName":"PDO::query","startTime":1517910615369065,"finishTime":1517910615369619,"spanContext":{"traceID":"d598d61e53e0419d","spanID":"cb680ac11f98720e","parentSpanID":"293bda65e49a6100"},"tags":{"span.kind":"client","db.statement":"SELECTgroup_type,name,state\n FROM ad_group \n WHERE 1 \n ORDER BYgroup_typeASC","db.type":"mysql","db.instance":"my_ad_promotion","peer.ipv4":"test-api.ad.mysql.meiyoucloud.com","peer.port":3306,"peer.service":"mysql"},"logs":[]},{"operationName":"PDO::query","startTime":1517910615370365,"finishTime":1517910615370904,"spanContext":{"traceID":"d598d61e53e0419d","spanID":"e979e7c4fb81c5da","parentSpanID":"293bda65e49a6100"},"tags":{"span.kind":"client","db.statement":"SELECTgroup_type,position_type,bid_type,min_price,state\n FROM ad_bid_types_new \n WHERE 1 \n ORDER BYidASC","db.type":"mysql","db.instance":"ad","peer.ipv4":"127.0.0.1","peer.port":26033,"peer.service":"mysql"},"logs":[]},{"operationName":"set","startTime":1517910615371073,"finishTime":1517910615371523,"spanContext":{"traceID":"d598d61e53e0419d","spanID":"a917f96c3de00966","parentSpanID":"293bda65e49a6100"},"tags":{"span.kind":"client","db.statement":

goangular commented 6 years ago

@silkcutKs 开启了debug ,没看到molten有错误日志出来

silkcutKs commented 6 years ago

@goangular 加一下我的qq吧, 你把源文件传给我,我看看。 qq:471051357