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 ¶
type SpanContext struct {
// contains filtered or unexported fields
}
SpanContext 调用链追踪信息
func NewSpanContext ¶
func NewSpanContext(opts ...SpanContextOption) *SpanContext
func (*SpanContext) FullKey ¶
func (c *SpanContext) FullKey(full bool) string
func (*SpanContext) Init ¶
func (c *SpanContext) Init(traceKey string) bool
Init key 分两种情况,1.rpc调用; 2.异步回调 eg: f.2-ee824ad0eb4dacf56b29d230a229c584|030019ac000010796162bc5900000021|030019ac000010796162bc5900000021
func (*SpanContext) Key ¶
func (c *SpanContext) Key(es SpanType) string
func (*SpanContext) Open ¶
func (c *SpanContext) Open(traceID string) bool
func (*SpanContext) ParentSpanID ¶
func (c *SpanContext) ParentSpanID() string
func (*SpanContext) Reset ¶
func (c *SpanContext) Reset()
func (*SpanContext) SpanID ¶
func (c *SpanContext) SpanID() string
func (*SpanContext) TraceID ¶
func (c *SpanContext) TraceID() string
func (*SpanContext) TraceType ¶
func (c *SpanContext) TraceType() int
type SpanContextOption ¶
type SpanContextOption func(*SpanContext)
func WithTraceKey ¶
func WithTraceKey(traceKey string) SpanContextOption
type Trace ¶
type Trace struct {
// contains filtered or unexported fields
}
func (*Trace) GetTraceFullKey ¶
GetTraceFullKey 获取 traceKey
func (*Trace) NeedTraceParam ¶
NeedTraceParam 控制参数打印
Click to show internal directories.
Click to hide internal directories.