http://zipkin.io/

  • collector
    • 效用:zipkin
      collector会对一个过来之为trace的数码(span)举办验证、存储并安装索引。
  • storage
  • search
  • webUI

六:zipkin工作流程图

  • 全链路追踪工具(查阅依赖关系
  • 查每个接口、每个service的施行进度(定位问题暴发点或者找寻性能瓶颈

第二、zipkin工作规律

 

1、使用zipkin,必须利用java8

https://github.com/openzipkin/zipkin/tree/master/zipkin-server server配置

2、基础架构(4单零部件)

  • spanId==C的span为什要来,是否可省去?

 

说明:

说明:parentId==null,表示该span就是root
span。

json 1

 

  • 意思:通过下3单Id,对数据开展组合
  • 三个Id(64位 long型数据)
    • TraceId
      • The overall ID of the trace.
      • Every span in a trace will
        share this ID.
    • SpanId
      • The ID for a particular span.
      • This may or may not be the same as the trace id.
    • ParentId
      • This is an optional ID that will only be present on child spans.
      • That is the span without a parent id is considered the root of the trace.

疑问

季、zipkin主题数据结构

json 2

参考:

 

  • Annotation(用途:用于固定一个request的起先同终止,cs/sr/ss/cr含有额外的信息,比如说时间点)
    • cs:Client Start – This sets the beginning of the span
      • 一个span的开始
    • sr:Server Receive – The server has received the request and
      will start processing it
    • ss:Server Send – The server has completed processing and has
      sent the request back to the client
    • cr:Client Receive – The client has received the response from
      the server. This sets the end of the span. The RPC is considered
      complete when this annotation is recorded

      • 一个span的结束
      • 当以此annotation被记录了,这多少个RPC也深受当好了
  • BinaryAnnotation(用途:They
    are meant to provide extra information about the RPC)
  • Span:就是一个请(包含一组Annotation和BinaryAnnotation)
    • Spans contain identifying information such as traceId, spandId,
      parentId, and RPC name
  • Trace
    • Traces are built by collecting all Spans that share a traceId
    • 通过traceId、spanId和parentId,被集及之span会汇集成一个tree,从而提供有一个request的共同体流程。(这吗是zipkin的办事规律)
  • transport效能:收集被trace的services的spans,并拿它转化为zipkin
    common Span,之后把这么些Spans传递的存储层。
  • 老两种重点的transport:
    • HTTP(默认)
      • 由此http
        headers来传递追踪音讯
      • header中的key
        • X-B3-TraceId: 64 encoded bits(id被encode为hex Strings)
        • json,X-B3-SpanId: 64 encoded bits
        • X-B3-ParentSpanId: 64 encoded bits
        • X-B3-Sampled: Boolean (either “1” or
          “0”)(上面的调用是否举行采样)
        • X-B3-Flags: a Long
    • Scribe
    • Kafka

三、zipkin架构

  • X和A可以齐

 

1、Transport

2、在生产条件,不会师指向每个请求都开展采样追踪(降低trace对周服务之性能损耗)

 

七、注意点

父子span关系:

  • sr-cs:网络延迟
  • ss-sr:逻辑处理时
  • cr-cs:整个工艺流程时

瞩目:时直接触算

五、Trace identifiers

json 3

一、zipkin作用

  • 创造有追踪标识符(tracingId,spanId,parentId),最终用一个request的流水线树构建出

相关文章

网站地图xml地图