Documentation ¶
Index ¶
- func MergeContexts(parent context.Context, contexts ...context.Context) context.Context
- func NewHTTPTraceProvider(ctx context.Context, res *resource.Resource, httpOpts []otlptracehttp.Option, ...) (*trace.TracerProvider, error)
- func NewResource(serviceName, serviceVersion string) (*resource.Resource, error)
- func SetupOTelSDK(ctx context.Context, tracerProvider *trace.TracerProvider) (shutdown func(context.Context) error, err error)
- func Tracer() otrace.Tracer
- type SamplingConfig
- type TracingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeContexts ¶ added in v0.0.179
func NewHTTPTraceProvider ¶
func NewHTTPTraceProvider(ctx context.Context, res *resource.Resource, httpOpts []otlptracehttp.Option, opts ...trace.TracerProviderOption) (*trace.TracerProvider, 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.
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
Click to show internal directories.
Click to hide internal directories.