tracing

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

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

Client 返回用于OpenTelemetry的新客户端中间件.

func Server

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

Server 返回用于OpenTelemetry的新服务器中间件.

Types

type MetadataCarrier

type MetadataCarrier metadata.MD

MetadataCarrier 是grpc元数据载体

func (MetadataCarrier) Clone

func (mc MetadataCarrier) Clone() MetadataCarrier

Clone 复制MetadataCarrier

func (MetadataCarrier) Del

func (mc MetadataCarrier) Del(key string)

Del 删除键

func (MetadataCarrier) Get

func (mc MetadataCarrier) Get(key string) string

Get 返回与传递的键关联的值.

func (MetadataCarrier) Keys

func (mc MetadataCarrier) Keys() []string

Keys 列出存储在此载体中的键.

func (MetadataCarrier) Set

func (mc MetadataCarrier) Set(key string, value string)

Set 存储键值对.

type Option

type Option func(*options)

Option 正在跟踪选项.

func WithPropagators

func WithPropagators(propagators propagation.TextMapPropagator) Option

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

Tracer 是otel跨度追踪器(Span,可以被翻译为跨度,可以被理解为一次方法调用,一个程序块的调用, 或者一次RPC/数据库访问.只要是一个具有完整时间周期的程序访问,都可以被认为是一个span.)

func NewTracer

func NewTracer(kind trace.SpanKind, opts ...Option) *Tracer

NewTracer 创建跟踪器实例

func (*Tracer) End

func (t *Tracer) End(ctx context.Context, span trace.Span, err error)

End 完成跟踪跨度

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, component string, operation string, carrier propagation.TextMapCarrier) (context.Context, trace.Span)

Start 开始跟踪跨度

Jump to

Keyboard shortcuts

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