Documentation
¶
Index ¶
Constants ¶
View Source
const (
ContextKey = "__LOG_TRACE_CONTEXT_KEY__"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface { // Processor // 类进程. // // 获取具体执行器的类进程, 基于此类进程启动/退出服务. Processor() process.Processor // Publish // 发布链路. Publish(spans ...Span) error // SetFormatter // 设置格式. SetFormatter(formatter Formatter) }
Executor 链路执行器.
type Formatter ¶
type Formatter interface { // Byte // 转字符码. Byte(vs ...Span) (body []byte, err error) // String // 转字符串. String(vs ...Span) (string, error) }
Formatter 格式化.
type OperatorManager ¶
type OperatorManager interface { // Generator // ID生成器. Generator() *id // GetExecutor // 执行器. GetExecutor() Executor // GetResource // 基础资源. GetResource() loggers.Kv // Push // 推送跨度. Push(span Span) // SetExecutor // 设置执行器. SetExecutor(v Executor) }
OperatorManager 链路操作接口.
var ( // Operator // 链路操作. Operator OperatorManager )
type Span ¶
type Span interface { ApplyRequest(req *http.Request) Child(name string) Span Context() context.Context Duration() time.Duration End() Kv() loggers.Kv Logger() SpanLogger Logs() []loggers.Log Name() string ParentSpanId() SpanId SpanId() SpanId StartTime() time.Time Trace() Trace }
Span 链路跨度.
type SpanLogger ¶
type SpanLogger interface { // Add // 添加 Key/Value 键值对. Add(key string, value interface{}) SpanLogger Debug(text string, args ...interface{}) Error(text string, args ...interface{}) Fatal(text string, args ...interface{}) Info(text string, args ...interface{}) Warn(text string, args ...interface{}) }
SpanLogger 跨度日志.
type Trace ¶
type Trace interface { // Context // 上下文. Context() context.Context // Kv // 链路Key/Value属性. Kv() loggers.Kv // Name // 链路名. Name() string // New // 创建跨度. // // 基于 Trace 生成新的链路跨度 Span. New(name string) Span // SpanId // 跨度ID. SpanId() SpanId // TraceId // 链路ID. TraceId() TraceId }
Trace 跨度组件.
func NewTraceFromContext ¶
NewTraceFromContext 链路跟踪.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package tracer_file 输出到文件中, 例如: /var/logs/2023-03/2023-03-01.trace.
|
Package tracer_file 输出到文件中, 例如: /var/logs/2023-03/2023-03-01.trace. |
Package tracer_jaeger 上报到Jaeger.
|
Package tracer_jaeger 上报到Jaeger. |
Package tracer_term 打印到终端/控制台.
|
Package tracer_term 打印到终端/控制台. |
Package tracer_zipkin 上报到Zipkin.
|
Package tracer_zipkin 上报到Zipkin. |
model
Package model contains the Zipkin V2 model which is used by the Zipkin Go tracer implementation.
|
Package model contains the Zipkin V2 model which is used by the Zipkin Go tracer implementation. |
Click to show internal directories.
Click to hide internal directories.