tracing

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(opts ...Option) middleware.Middleware

Client 返回一个客户端跟踪中间件

func Server

func Server(opts ...Option) middleware.Middleware

Server 返回一个服务端跟踪中间件

Types

type Option

type Option func(*options)

Option 是跟踪中间件的选项

func WithTracer

func WithTracer(tracer Tracer) Option

WithTracer 设置跟踪器

type Span

type Span interface {
	// End 结束Span
	End()
	// SetTag 设置Span标签
	SetTag(key string, value interface{})
	// SetError 设置Span错误
	SetError(err error)
}

Span 是跟踪Span接口

type Tracer

type Tracer interface {
	// Start 开始一个新的跟踪Span
	Start(ctx context.Context, operation string) (context.Context, Span)
}

Tracer 是跟踪器接口

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL