tracelog

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: MIT Imports: 6 Imported by: 2

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() tracing.TraceFunc

Types

type Config

type Config struct {
	RequestIdHeader string
	RequestIdFunc
	tracing.NewFunc
	// contains filtered or unexported fields
}

func TraceConfig added in v0.1.0

func TraceConfig() *Config

func (*Config) Funcs added in v0.1.0

func (c *Config) Funcs() []tracing.TraceFunc

func (*Config) GetRequestId

func (c *Config) GetRequestId(ctx context.Context, req *http.Request) string

type Option

type Option func(c *Config)

func WithNewFunc added in v0.1.2

func WithNewFunc(f tracing.NewFunc) Option

func WithRequestIdFunc added in v0.1.0

func WithRequestIdFunc(f RequestIdFunc) Option

func WithRequestIdHeader added in v0.1.0

func WithRequestIdHeader(header string) Option

func WithTraceFuncs added in v0.1.0

func WithTraceFuncs(opt ...tracing.TraceFunc) Option

type RequestIdFunc added in v0.1.0

type RequestIdFunc func(ctx context.Context, req *http.Request) string

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