telemetry

package
v4.80.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 27 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOpenTelemetryToClient

func AddOpenTelemetryToClient(httpClient *http.Client, meterProvider meter.MeterProvider, tracerProvider tr.TracerProvider) *http.Client

func AsyncRouteTagMiddleware added in v4.71.0

func AsyncRouteTagMiddleware(next http.Handler) http.Handler

func ExtractContext added in v4.69.9

func ExtractContext(ctx context.Context, headers map[string]any) context.Context

func InjectToAmqp added in v4.69.9

func InjectToAmqp(ctx context.Context, payload amqp.Publishing) amqp.Publishing

func SetRouteTag added in v4.71.0

func SetRouteTag(ctx context.Context, route string)

Types

type Config

type Config struct {
	URL         string
	Rate        string
	TraceUint64 bool
}

func Flags

func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) *Config

type FinishSpan added in v4.64.0

type FinishSpan = func(err *error, options ...tr.SpanEndOption)

func StartSpan

func StartSpan(ctx context.Context, tracer tr.Tracer, name string, opts ...tr.SpanStartOption) (context.Context, FinishSpan)

type OtlpLogger added in v4.69.1

type OtlpLogger struct {
	slog.Handler
	Attributes []slog.Attr
	Uint64     bool
}

func (OtlpLogger) Handle added in v4.69.1

func (tl OtlpLogger) Handle(ctx context.Context, r slog.Record) error

type Service added in v4.64.0

type Service struct {
	TraceUint64 bool
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, config *Config) (*Service, error)

func (*Service) AddTraceToLogHandler added in v4.69.2

func (s *Service) AddTraceToLogHandler(handler slog.Handler) slog.Handler

func (*Service) Close added in v4.64.0

func (s *Service) Close(ctx context.Context)

func (*Service) GetServiceVersionAndEnv added in v4.75.0

func (s *Service) GetServiceVersionAndEnv() (service, version, env string)

func (*Service) MeterProvider added in v4.64.0

func (s *Service) MeterProvider() meter.MeterProvider

func (*Service) Middleware added in v4.64.0

func (s *Service) Middleware(name string) func(next http.Handler) http.Handler

func (*Service) TracerProvider added in v4.64.0

func (s *Service) TracerProvider() tr.TracerProvider

type SimpleHeaderCarrier added in v4.69.9

type SimpleHeaderCarrier map[string]any

func (SimpleHeaderCarrier) Get added in v4.69.9

func (shc SimpleHeaderCarrier) Get(key string) string

func (SimpleHeaderCarrier) Keys added in v4.69.9

func (shc SimpleHeaderCarrier) Keys() []string

func (SimpleHeaderCarrier) Set added in v4.69.9

func (shc SimpleHeaderCarrier) Set(key string, value string)

Jump to

Keyboard shortcuts

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