tracing

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 17 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attributes added in v0.3.0

func Attributes(options ...KeyValueOption) []attribute.KeyValue

func ClientIP

func ClientIP(req *http.Request) string

func Key

func Key() interface{}

func NewTracerProvider added in v0.3.0

func Service

func Service() string

func Setup

func Setup(opt ...Option)

func TextMapPropagator added in v0.3.0

func TextMapPropagator() propagation.TextMapPropagator

func TracerProviderOptions added in v0.3.0

func TracerProviderOptions(ctx context.Context, options ...TracerProviderOption) ([]sdktrace.TracerProviderOption, error)

func Value added in v0.3.0

func Value(ctx context.Context) interface{}

func WithContext added in v0.3.0

func WithContext(ctx context.Context, tr Tracing) context.Context

func WithTrace

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

Types

type IpHeader added in v0.2.0

type IpHeader func(req *http.Request) (string, bool)

func FixedIp added in v0.2.0

func FixedIp(ip string) IpHeader

func Forwarded added in v0.2.0

func Forwarded() IpHeader

func RemoteAddr added in v0.2.0

func RemoteAddr() IpHeader

func XEnvoyExternalAddress added in v0.2.0

func XEnvoyExternalAddress() IpHeader

func XForwardedFor added in v0.2.0

func XForwardedFor() IpHeader

func XRealIp added in v0.2.0

func XRealIp() IpHeader

type IpHeaders added in v0.2.0

type IpHeaders []IpHeader

func DefaultIpHeaders added in v0.2.0

func DefaultIpHeaders() IpHeaders

func (IpHeaders) Append added in v0.2.0

func (h IpHeaders) Append(header IpHeader) IpHeaders

func (IpHeaders) Get added in v0.2.0

func (h IpHeaders) Get(req *http.Request) (string, bool)

func (IpHeaders) Prepend added in v0.2.0

func (h IpHeaders) Prepend(header IpHeader) IpHeaders

type KeyValueOption added in v0.3.0

type KeyValueOption func(attrs []attribute.KeyValue) []attribute.KeyValue

func WithServiceName added in v0.3.0

func WithServiceName(name string) KeyValueOption

func WithVersion added in v0.3.0

func WithVersion(version string) KeyValueOption

type LogFunc added in v0.3.0

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

type NewFunc

type NewFunc func(ctx context.Context, req *http.Request) Tracing

type Option added in v0.2.0

type Option func()

func LogOption added in v0.3.0

func LogOption(f1 LogFunc, f ...LogFunc) Option

func ServiceName added in v0.2.0

func ServiceName(name string) Option

func WithIpHeaders added in v0.2.0

func WithIpHeaders(keys ...IpHeader) Option

type TracerBuilder added in v0.3.0

type TracerBuilder struct {
	Propagator propagation.TextMapPropagator
	Options    []sdktrace.TracerProviderOption
}

func NewTracer added in v0.3.0

func NewTracer() *TracerBuilder

func (*TracerBuilder) Build added in v0.3.0

func (*TracerBuilder) WithOptions added in v0.3.0

func (b *TracerBuilder) WithOptions(opts ...sdktrace.TracerProviderOption) *TracerBuilder

func (*TracerBuilder) WithPropagator added in v0.3.0

func (b *TracerBuilder) WithPropagator(propagator propagation.TextMapPropagator) *TracerBuilder

type TracerProviderOption added in v0.3.0

type TracerProviderOption func(ctx context.Context) (sdktrace.TracerProviderOption, error)

func WithGrpcExporter added in v0.3.0

func WithGrpcExporter(opts ...otlptracegrpc.Option) TracerProviderOption

func WithHttpExporter added in v0.3.0

func WithHttpExporter(opts ...otlptracehttp.Option) TracerProviderOption

func WithResource added in v0.3.0

func WithResource(attrs ...attribute.KeyValue) TracerProviderOption

func WithSampler added in v0.3.0

func WithSampler(fractions ...float64) TracerProviderOption

type Tracing

type Tracing interface {
	WithTrace(ctx context.Context, event *zerolog.Event) *zerolog.Event
	Dump(ctx context.Context, log *zerolog.Event) *zerolog.Event
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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