tracing

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MulanPSL-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSpanId

func GetSpanId(ctx context.Context) string

func GetString

func GetString(ctx context.Context, key string) string

GetString 从链路中获取指定key的字符串值

func GetTraceId

func GetTraceId(ctx context.Context) string

获取链路跟踪ID

func GetValue

func GetValue(ctx context.Context, key string) interface{}

func InitJaeger

func InitJaeger(serviceName, endpoint string) (flush func(), err error)

InitJaeger 初始化jaeger并将其注册到全局TracerProvider。 输出参数“flush”用于等待上载导出的跟踪范围, 如果您的程序正在结束,并且您不想丢失最近的跨距,则此选项非常有用

func NewAPISpan

func NewAPISpan(r *ghttp.Request, spanName string) (context.Context, *gtrace.Span)

NewSpan HTTP

func NewRPCClient

func NewRPCClient(address string) (error, *gRPCClient)

NewRPCClient 建立rpc连接

func NewRPCServer

func NewRPCServer(address string) (error, *gRPCServer)

NewServer 启动一个grpc服务

func NewSpan

func NewSpan(ctx context.Context, spanName string) (context.Context, *gtrace.Span)

NewSpan 第一个span获取方式context.Background()

func Request

func Request(ctx context.Context, url string) string

Request HTTP Client 向服务端发送请求

func Set

func Set(ctx context.Context, key string, value interface{}) context.Context

Set 链路设置键值

Types

This section is empty.

Jump to

Keyboard shortcuts

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