trace

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachTraceID

func AttachTraceID(ctx context.Context) (traceID string, result context.Context)

AttachTraceID 为 context 附加 trace_id

func ForkTracedContext added in v1.2.6

func ForkTracedContext(ctx context.Context) (forked context.Context)

ForkTracedContext 从已有 trace_id 的 context 中生成一个新的 context,用于在新的 goroutine 中使用

func GetTraceID

func GetTraceID(ctx context.Context) (traceID string, result context.Context)

GetTraceID 从 context 中获取 trace_id,如果获取失败,则重新生成

func NewContextWithTraceID

func NewContextWithTraceID() context.Context

NewContextWithTraceID 从 context.Background 生成一个新的 context,并附加 trace_id

func Stack

func Stack(skip int) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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