gotraceutil

package module
v0.0.0-...-50dcc7a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTracingIDKey = "TracingID"
)

Variables

This section is empty.

Functions

func AppendTracingKeys

func AppendTracingKeys(keys []string)

func GRPCUnaryClientInterceptor

func GRPCUnaryClientInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

func GRPCUnaryServerInterceptor

func GRPCUnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)

func GetTracingIDKey

func GetTracingIDKey() string

func GetTracingKeys

func GetTracingKeys() []string

func GinMiddleware

func GinMiddleware() gin.HandlerFunc

func NewGORMLogger

func NewGORMLogger(config gormlogger.Config) gormlogger.Interface

func NewLogrusHook

func NewLogrusHook() logrus.Hook

func Parse

func Parse(ctx context.Context) (labels map[string]string)

func SetTracingIDGenerator

func SetTracingIDGenerator(generator TracingIDGenerator)

func SetTracingIDKey

func SetTracingIDKey(key string)

func Trace

func Trace(ctx context.Context) context.Context

Types

type LogrusHook

type LogrusHook struct{}

func (*LogrusHook) Fire

func (hook *LogrusHook) Fire(entry *logrus.Entry) error

func (*LogrusHook) Levels

func (hook *LogrusHook) Levels() []logrus.Level

type TracingIDGenerator

type TracingIDGenerator func() string

Jump to

Keyboard shortcuts

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