Documentation ¶
Index ¶
- Constants
- Variables
- func GetTraceParamMaxLen() uint
- func SetTraceParamMaxLen(len uint)
- func TraceContextInitType(tid string) (tType int, maxLen uint)
- type ENeedParam
- type ESpanType
- type TraceContext
- type TraceData
- func (t *TraceData) GetTraceKey(es ESpanType) string
- func (t *TraceData) GetTraceKeyFull(full bool) string
- func (t *TraceData) GetTraceType() int
- func (t *TraceData) InitTrace(traceKey string) bool
- func (t *TraceData) NeedTraceParam(es ESpanType, len uint) ENeedParam
- func (t *TraceData) NewSpan()
- func (t *TraceData) OpenTrace(traceFlag int, maxLen uint) bool
Constants ¶
View Source
const ( TraceAnnotationTS = "ts" TraceAnnotationTE = "te" TraceAnnotationCS = "cs" TraceAnnotationCR = "cr" TraceAnnotationSR = "sr" TraceAnnotationSS = "ss" )
Variables ¶
View Source
var ( EstCS ESpanType = 1 EstCR ESpanType = 2 EstSR ESpanType = 4 EstSS ESpanType = 8 EstTS ESpanType = 9 EstTE ESpanType = 10 EnpNo ENeedParam = 0 EnpNormal ENeedParam = 1 EnpOverMaxLen ENeedParam = 2 )
Functions ¶
func TraceContextInitType ¶
TraceContextInitType parse type and maxLen
Types ¶
type ENeedParam ¶
type ENeedParam int
func NeedTraceParam ¶
func NeedTraceParam(es ESpanType, traceID string, len uint) ENeedParam
NeedTraceParam 控制参数打印
func TraceContextNeedParam ¶
func TraceContextNeedParam(es ESpanType, tType int, len uint, maxLen uint) ENeedParam
TraceContextNeedParam return: 0 不需要参数, 1:正常打印参数, 2:参数太长返回默认串
type TraceContext ¶
type TraceContext struct {
// contains filtered or unexported fields
}
func (*TraceContext) Init ¶
func (c *TraceContext) Init(traceKey string) bool
Init key 分两种情况,1.rpc调用; 2.异步回调 eg: f.2-ee824ad0eb4dacf56b29d230a229c584|030019ac000010796162bc5900000021|030019ac000010796162bc5900000021
func (*TraceContext) Reset ¶
func (c *TraceContext) Reset()
type TraceData ¶
type TraceData struct { TraceCall bool TraceContext *TraceContext }
func NewTraceData ¶
func NewTraceData() *TraceData
func (*TraceData) GetTraceKey ¶
GetTraceKey 获取 traceKey
func (*TraceData) GetTraceKeyFull ¶
GetTraceKeyFull 获取 traceKey
func (*TraceData) NeedTraceParam ¶
func (t *TraceData) NeedTraceParam(es ESpanType, len uint) ENeedParam
NeedTraceParam 控制参数打印
Click to show internal directories.
Click to hide internal directories.