Documentation ¶
Index ¶
- Constants
- Variables
- func BeginSpan()
- func EndSpan()
- func Exists() bool
- func GetParentSpanId() string
- func GetSpanId() string
- func GetTraceId() string
- func GetTraceSpanId() string
- func Init()
- func InitByHttp(reqHeader, respHeader http.Header)
- func InitByValue(traceId, spanId, parentSpanId string)
- func Reset()
- func Setup(appName string)
- type Counter
- type ISequence
- type ISpan
- type ITracer
- type LinkedHashMap
- type LogMap
- type Sequence
- type Span
- type Tracer
Constants ¶
View Source
const ( RootSpanId = "" RootParentSpanId = "" SeparatorSpanIdIndex = "." SeparatorTraceIdSpanId = "." )
View Source
const ( TraceIdName = "Trace-Id" SpanIdName = "Span-Id" ParentSpanIdName = "Parent-Span-Id" TraceSpanIdName = "Trace-Span-Id" )
Variables ¶
View Source
var Utils *traceUtils
Functions ¶
func GetParentSpanId ¶
func GetParentSpanId() string
func GetTraceId ¶
func GetTraceId() string
func GetTraceSpanId ¶
func GetTraceSpanId() string
func InitByHttp ¶
func InitByValue ¶
func InitByValue(traceId, spanId, parentSpanId string)
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter 一天的计数器
func DefaultCounter ¶
func DefaultCounter() *Counter
type ISpan ¶
type ISpan interface { //ContinueSpan 开启子 Span ContinueSpan() ISpan //GetTraceId 获取当前 Span 的 TraceId GetTraceId() string //GetSpanId 获取当前 Span 的 SpanId GetSpanId() string //GetParentSpanId 获取当前 Span 的 ParentSpanId GetParentSpanId() string //GetTraceSpanId 获取当前 Span 的 TraceSpanId GetTraceSpanId() string }
var EmptySpan ISpan = &emptySpan{}
type LinkedHashMap ¶
type LinkedHashMap struct {
// contains filtered or unexported fields
}
func (*LinkedHashMap) Put ¶
func (t *LinkedHashMap) Put(key string, value any)
func (*LinkedHashMap) String ¶
func (t *LinkedHashMap) String() string
type Sequence ¶
type Sequence struct {
// contains filtered or unexported fields
}
Sequence 计数器, 日期变化后从 1 开始计数
func NewSequence ¶
func NewSequence() *Sequence
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
func (*Span) ContinueSpan ¶
func (*Span) GetParentSpanId ¶
func (*Span) GetTraceId ¶
func (*Span) GetTraceSpanId ¶
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func (Tracer) CreateContinueSpan ¶
func (Tracer) CreateRoot ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.