tracer

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: AGPL-3.0 Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestIdHeaderKey = "X-Request-ID"
View Source
var TraceIdHeaderKey = "X-Trace-ID"

Functions

func GetTraceId

func GetTraceId() string

GetTraceId 获取协程的TraceId

func GetTracer

func GetTracer() std.Tracer

GetTracer 获取`Tracer`组件

func Go

func Go(fn func())

Go 开启一个新的协程;为了让traceId能够在协程间传递,必须使用 `tracer.Go(fn)` 代替 `go fn()`

func PanicTrace

func PanicTrace(kb int) []byte

func RecoverSetTraceId added in v0.1.19

func RecoverSetTraceId(traceId string, fn func())

func SetTraceId

func SetTraceId(traceId string, fn func())

SetTraceId 给函数所在的协程设置traceId;对`std.Tracer:SetTraceId`的封装

func SetTracer

func SetTracer(t std.Tracer)

SetTracer 设置Tracer,覆盖默认的tracer对象

func Trace

func Trace(context std.GinContent)

Trace Trace中间件,用于在"中间件"链路中注入traceId

Types

This section is empty.

Jump to

Keyboard shortcuts

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