Versions in this module Expand all Collapse all v1 v1.0.0 Oct 29, 2021 Changes in this version + const CALLER + const DEFAULT_TRACE_SAMPLE_RATE + const DIDI_HEADER_HINT_CODE + const DIDI_HEADER_HINT_CONTENT + const DIDI_HEADER_RID + const DIDI_HEADER_SPANID + const DLTagBackendRPCFailed + const DLTagHTTPFailed + const DLTagHTTPSuccess + const DLTagMysqlFailed + const DLTagMysqlSuccess + const DLTagRedisFailed + const DLTagRedisSuccess + const DLTagRequestIn + const DLTagRequestOut + const DLTagThriftFailed + const DLTagThriftSuccess + const DLTagUndefined + const EMPRY_TRACE_ID + const EMPTY_SPAN_ID + const HINT_CODE + const HINT_CONTENT + const HINT_NORMAL_TRAFFIC + const HINT_PRESSURE_TRAFFIC + const HINT_TRACE_SAMPLE + const HINT_TRACE_SAMPLE_INIT + const SPANID + const SRC_METHOD + const TRACEID + func FormatCtx(ctx context.Context) string + func GenSpanId() string + func GenTraceId() string + func GetClientAddr(req *http.Request) string + func PutTrace(trace *Trace) + func SetCtxTrace(ctx context.Context, val *Trace) context.Context + type HintContent struct + Sample HintSampling + type HintSampling struct + Code int64 + Rate int64 + type ICtxKey interface + GetCtxKey func() interface{} + func NewCtxKey() ICtxKey + type Trace struct + Caller string + FormatString string + From string + HintCode string + HintContent string + Host string + Method string + Params string + Sampling int + SpanId string + SrcMethod string + TraceId string + URL string + func GetCtxTrace(ctx context.Context) (*Trace, bool) + func New(req *http.Request) (trace *Trace) + func NewWithMap(m map[string]string) (trace *Trace) + func (tr *Trace) AddHttpHeader(request *http.Request) + func (tr *Trace) GenSpanId() string + func (tr *Trace) GetClientAddr(req *http.Request) string + func (tr *Trace) GetHintCode(req *http.Request) string + func (tr *Trace) GetHintContent(req *http.Request) string + func (tr *Trace) GetHttpHost(req *http.Request) string + func (tr *Trace) GetHttpMethod(req *http.Request) string + func (tr *Trace) GetHttpParams(req *http.Request) string + func (tr *Trace) GetHttpURL(req *http.Request) string + func (tr *Trace) GetSpanId(req *http.Request) string + func (tr *Trace) GetTraceId(req *http.Request) string + func (tr *Trace) IsPressureTraffic() bool + func (tr *Trace) IsTraceSampleEnabled() (hit bool) + func (tr *Trace) String() string