opentracing & jeager

简介

opentracing是一个分布式追踪系统的client接口标准。jeager是uber的tracing系统。

收集的资料

specification: https://opentracing.io/specification/
[1] https://developer.aliyun.com/article/514488
[2] http://peter.bourgon.org/blog/2017/02/21/metrics-tracing-and-logging.html?spm=a2c6h.12873639.0.0.61b453f6kQ1TwU
[3] https://github.com/opentracing/specification/blob/master/specification.md
[4] https://github.com/opentracing-contrib/opentracing-specification-zh/blob/master/semantic_conventions.md
[5] https://github.com/opentracing/opentracing-go
[6] https://github.com/yurishkuro/opentracing-tutorial/tree/master/go
[7] https://godoc.org/github.com/opentracing/opentracing-go

建议多看几遍spec,比什么博客翻译好多了。不得不说很多博客和翻译都很aji(include me)。

tracing的概述

https://github.com/opentracing/specification/blob/master/specification.md
https://blog.csdn.net/u013970991/article/details/77822060

What

从概念上而言,tracing是分布式追踪工具,对分布式系统中的某request的流向进行追踪。如上面的文章所言。

入侵式:

也因为tracing是追踪具体的request的执行流,所以须有侵入式的方式植入代码。

因为入侵式需要深入客户代码,显然是不能依赖于其他公司的三方库,所以大家只有规范接口,而不同的公司的接口规范可能是不同的(大家想法不一样嘛),所以需要标准化,接口的具体内容格式化显然是不现实的(大家的需求不同),所以需要一个抽象层次比较高,且开源的标准。如是opentracing。

自定义实现:

在opentracing中只是规范了交互标准,并没有内容实现,所以我们需要去自定义实现Tracer,同时依赖开源的Tracer也是可以的。

OpenTracing的实现中,比较流行的为 Jaeger 和 Zipkin。

jeager

https://zhuanlan.zhihu.com/p/44824994
https://www.jaegertracing.io/docs/1.18/

jeager是对Tracing系统的实现。

Tracer

关于文档,可以搜索go doc,然后索引jeager-client

// TraceID represents unique 128bit identifier of a trace
type TraceID struct {
   
	High, Low uint64
}
// Tracer implements opentracing.Tracer.
type Tracer struct {
   
	serviceName string
	hostIPv4    uint32 // this is for zipkin endpoint conversion

	sampler  SamplerV2
	reporter Reporter
	metrics  Metrics
	logger   log.DebugLogger

	timeNow      func() time.Time
	randomNumb
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值