trace

package
v0.0.0-...-317a6c1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendTraceKeys

func AppendTraceKeys(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 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 SetTraceIDGenerator

func SetTraceIDGenerator(generator TraceIDGenerator)

func SetTraceIDKey

func SetTraceIDKey(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 TraceIDGenerator

type TraceIDGenerator func() string

Jump to

Keyboard shortcuts

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