observability

package
v0.0.199 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeContexts added in v0.0.179

func MergeContexts(parent context.Context, contexts ...context.Context) context.Context

func NewHTTPTraceProvider

func NewHTTPTraceProvider(ctx context.Context, res *resource.Resource, httpOpts []otlptracehttp.Option, opts ...trace.TracerProviderOption) (*trace.TracerProvider, error)

func NewResource

func NewResource(serviceName, serviceVersion string) (*resource.Resource, error)

func SetupOTelSDK

func SetupOTelSDK(ctx context.Context, tracerProvider *trace.TracerProvider) (shutdown func(context.Context) error, err error)

SetupOTelSDK bootstraps the OpenTelemetry pipeline. If it does not return an error, make sure to call shutdown for proper cleanup.

func Tracer

func Tracer() otrace.Tracer

Types

type SamplingConfig added in v0.0.179

type SamplingConfig struct {
	Rate float64 `yaml:"rate" default:"0.01"`
}

type TracingConfig

type TracingConfig struct {
	Enabled     bool                       `yaml:"enabled" default:"false"`
	Endpoint    string                     `yaml:"endpoint" default:""`
	URLPath     string                     `yaml:"urlPath" default:""`
	Timeout     human.Duration             `yaml:"timeout" default:"15s"`
	Compression bool                       `yaml:"compression" default:"true"`
	Headers     map[string]string          `yaml:"headers"`
	Insecure    bool                       `yaml:"insecure" default:"false"`
	Retry       *otlptracehttp.RetryConfig `yaml:"retry"`
	TLS         *tls.Config                `yaml:"tls"`
	Sampling    SamplingConfig             `yaml:"sampling"`
}

func (*TracingConfig) AsOTelOpts

func (t *TracingConfig) AsOTelOpts() []otlptracehttp.Option

func (*TracingConfig) Validate

func (t *TracingConfig) Validate() error

Jump to

Keyboard shortcuts

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