tracelog

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpanId  = "span_id"
	Id      = "trace_id"
	Sampled = "sampled"
)

Variables

This section is empty.

Functions

func New

func New() func(ctx context.Context, req *http.Request) tracing.Tracing

func Setup

func Setup(opt ...Option)

func WithTrace

func WithTrace(ctx context.Context, event *zerolog.Event) *zerolog.Event

Types

type Config

type Config struct {
	RequestId     string
	LogGroupNames []string
}

type Option

type Option func(c *Config)

func LogGroupNames

func LogGroupNames(names ...string) Option

func RequestId

func RequestId(header string) Option

type TracingContext

type TracingContext struct {
	Path      string
	ClientIP  string
	RequestID string
	Service   string
}

func (*TracingContext) Dump

func (tc *TracingContext) Dump(ctx context.Context, log *zerolog.Event) *zerolog.Event

func (*TracingContext) WithTrace

func (tc *TracingContext) WithTrace(ctx context.Context, event *zerolog.Event) *zerolog.Event

Jump to

Keyboard shortcuts

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