之前,在公司内部做了一个PPT分享,这个分享是我在认真研究了zipkin的源码后的一些体会。
截图如下:
json文件内容见:
[
{
"traceId": "daaed0921874ebc3",
"id": "daaed0921874ebc3",
"name": "gateway->service1",
"timestamp": 1476197067420000,
"duration": 4694000,
"annotations": [
{
"timestamp": 1476197067420000,
"value": "cs",
"endpoint": {
"serviceName": "gateway",
"ipv4": "1.2.3.110"
}
},
{
"timestamp": 1476197067527500,
"value": "sr",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
},
{
"timestamp": 1476197072006500,
"value": "ss",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
},
{
"timestamp": 1476197072114000,
"value": "cr",
"endpoint": {
"serviceName": "gateway",
"ipv4": "1.2.3.110"
}
}
],
"binaryAnnotations": [
{
"key": "error",
"value": "错误发生",
"endpoint": {
"serviceName": "gateway",
"ipv4": "1.2.3.110"
}
},
{
"key": "http.status_code",
"value": "200",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
},
{
"key": "http.url",
"value": "/service1",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
},
{
"key": "http.url",
"value": "http://localhost:8080/service1",
"endpoint": {
"serviceName": "gateway",
"ipv4": "1.2.3.110"
}
},
{
"key": "任何你想上报的信息点",
"value": "java.lang.Exception\r\n\tat zipkin_public_training.Zipkin.execute(Zipkin.java:76)\r\n\tat zipkin_public_training.Zipkin.step9(Zipkin.java:64)\r\n\tat zipkin_public_training.Zipkin.step8(Zipkin.java:59)\r\n\tat zipkin_public_training.Zipkin.step7(Zipkin.java:55)\r\n\tat zipkin_public_training.Zipkin.step6(Zipkin.java:51)\r\n\tat zipkin_public_training.Zipkin.step5(Zipkin.java:47)\r\n\tat zipkin_public_training.Zipkin.step4(Zipkin.java:43)\r\n\tat zipkin_public_training.Zipkin.step3(Zipkin.java:39)\r\n\tat zipkin_public_training.Zipkin.step2(Zipkin.java:35)\r\n\tat zipkin_public_training.Zipkin.step1(Zipkin.java:31)\r\n\tat zipkin_public_training.Zipkin.step0(Zipkin.java:27)\r\n\tat zipkin_public_training.Zipkin.main(Zipkin.java:23)\r\n",
"endpoint": {
"serviceName": "gateway",
"ipv4": "1.2.3.110"
}
}
]
},
{
"traceId": "daaed0921874ebc3",
"id": "411d4c32c102a974",
"name": "service1->service2",
"parentId": "daaed0921874ebc3",
"timestamp": 1476197069584500,
"duration": 1168000,
"annotations": [
{
"timestamp": 1476197069584500,
"value": "cs",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
},
{
"timestamp": 1476197069648500,
"value": "sr",
"endpoint": {
"serviceName": "service2",
"ipv4": "1.2.3.112"
}
},
{
"timestamp": 1476197070688500,
"value": "ss",
"endpoint": {
"serviceName": "service2",
"ipv4": "1.2.3.112"
}
},
{
"timestamp": 1476197070752500,
"value": "cr",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
}
],
"binaryAnnotations": [
{
"key": "http.status_code",
"value": "200",
"endpoint": {
"serviceName": "service2",
"ipv4": "1.2.3.112"
}
},
{
"key": "http.url",
"value": "http://localhost:8089/service2",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
},
{
"key": "http.url",
"value": "/service2",
"endpoint": {
"serviceName": "service2",
"ipv4": "1.2.3.112"
}
}
]
},
{
"traceId": "daaed0921874ebc3",
"id": "7c0d7d897a858217",
"name": "service1->service3",
"parentId": "daaed0921874ebc3",
"timestamp": 1476197070754500,
"duration": 1216000,
"annotations": [
{
"timestamp": 1476197070754500,
"value": "cs",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
},
{
"timestamp": 1476197070833000,
"value": "sr",
"endpoint": {
"serviceName": "service3",
"ipv4": "1.2.3.113"
}
},
{
"timestamp": 1476197071892000,
"value": "ss",
"endpoint": {
"serviceName": "service3",
"ipv4": "1.2.3.113"
}
},
{
"timestamp": 1476197071970500,
"value": "cr",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
}
],
"binaryAnnotations": [
{
"key": "http.status_code",
"value": "200",
"endpoint": {
"serviceName": "service3",
"ipv4": "1.2.3.113"
}
},
{
"key": "http.url",
"value": "/service3",
"endpoint": {
"serviceName": "service3",
"ipv4": "1.2.3.113"
}
},
{
"key": "http.url",
"value": "http://localhost:8090/service3",
"endpoint": {
"serviceName": "service1",
"ipv4": "1.2.3.111"
}
}
]
}
]