Documentation ¶
Index ¶
- Constants
- func GetTraceParamMaxLen() uint
- func SetTraceParamMaxLen(len uint)
- type NeedParam
- type SpanContext
- func (c *SpanContext) FullKey(full bool) string
- func (c *SpanContext) Init(traceKey string) bool
- func (c *SpanContext) Key(es SpanType) string
- func (c *SpanContext) NewSpan()
- func (c *SpanContext) Open(traceID string) bool
- func (c *SpanContext) ParentSpanID() string
- func (c *SpanContext) Reset()
- func (c *SpanContext) SpanID() string
- func (c *SpanContext) TraceID() string
- func (c *SpanContext) TraceType() int
- type SpanContextOption
- type SpanType
- type Trace
- func (t *Trace) Call() bool
- func (t *Trace) GetTraceFullKey(full bool) string
- func (t *Trace) GetTraceKey(es SpanType) string
- func (t *Trace) GetTraceType() int
- func (t *Trace) InitTrace(traceKey string) bool
- func (t *Trace) NeedTraceParam(es SpanType, len uint) NeedParam
- func (t *Trace) NewSpan()
- func (t *Trace) OpenTrace(traceFlag int, maxLen uint) bool
- func (t *Trace) SetCall(call bool)
- func (t *Trace) SpanContext() *SpanContext
Constants ¶
View Source
const ( EstCS SpanType = 1 EstCR SpanType = 2 EstSR SpanType = 4 EstSS SpanType = 8 EstTS SpanType = 9 EstTE SpanType = 10 EnpNo NeedParam = 0 EnpNormal NeedParam = 1 EnpOverMaxLen NeedParam = 2 AnnotationTS = "ts" AnnotationTE = "te" AnnotationCS = "cs" AnnotationCR = "cr" AnnotationSR = "sr" AnnotationSS = "ss" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SpanContext ¶ added in v1.4.38
type SpanContext struct {
// contains filtered or unexported fields
}
SpanContext 调用链追踪信息
func NewSpanContext ¶ added in v1.4.38
func NewSpanContext(opts ...SpanContextOption) *SpanContext
func (*SpanContext) FullKey ¶ added in v1.4.38
func (c *SpanContext) FullKey(full bool) string
func (*SpanContext) Init ¶ added in v1.4.38
func (c *SpanContext) Init(traceKey string) bool
Init key 分两种情况,1.rpc调用; 2.异步回调 eg: f.2-ee824ad0eb4dacf56b29d230a229c584|030019ac000010796162bc5900000021|030019ac000010796162bc5900000021
func (*SpanContext) Key ¶ added in v1.4.38
func (c *SpanContext) Key(es SpanType) string
func (*SpanContext) Open ¶ added in v1.4.38
func (c *SpanContext) Open(traceID string) bool
func (*SpanContext) ParentSpanID ¶ added in v1.4.38
func (c *SpanContext) ParentSpanID() string
func (*SpanContext) Reset ¶ added in v1.4.38
func (c *SpanContext) Reset()
func (*SpanContext) SpanID ¶ added in v1.4.38
func (c *SpanContext) SpanID() string
func (*SpanContext) TraceID ¶ added in v1.4.38
func (c *SpanContext) TraceID() string
func (*SpanContext) TraceType ¶ added in v1.4.38
func (c *SpanContext) TraceType() int
type SpanContextOption ¶ added in v1.4.38
type SpanContextOption func(*SpanContext)
func WithTraceKey ¶ added in v1.4.38
func WithTraceKey(traceKey string) SpanContextOption
type Trace ¶ added in v1.4.38
type Trace struct {
// contains filtered or unexported fields
}
func (*Trace) GetTraceFullKey ¶ added in v1.4.38
GetTraceFullKey 获取 traceKey
func (*Trace) GetTraceKey ¶ added in v1.4.38
GetTraceKey 获取 traceKey
func (*Trace) GetTraceType ¶ added in v1.4.38
GetTraceType 获取 trace type
func (*Trace) InitTrace ¶ added in v1.4.38
InitTrace 获取 traceKey
func (*Trace) NeedTraceParam ¶ added in v1.4.38
NeedTraceParam 控制参数打印
func (*Trace) OpenTrace ¶ added in v1.4.38
OpenTrace 业务主动打开调用链 @param traceFlag: 调用链日志输出参数控制,取值范围0-15, 0 不用打参数, 其他情况按位做控制开关,从低位到高位分别控制CS、CR、SR、SS,为1则输出对应参数 @param maxLen: 参数输出最大长度, 不传或者默认0, 则按服务模板默认取值
func (*Trace) SpanContext ¶ added in v1.4.38
func (t *Trace) SpanContext() *SpanContext
SpanContext 获取 SpanContext
Click to show internal directories.
Click to hide internal directories.