otel

package
v1.0.0-dev.49 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInsecure

func IsInsecure() bool

func IsMetricEnabled

func IsMetricEnabled() bool

IsMetricEnabled returns config value from key boost.factory.otel.enabled where default is true.

func IsTraceEnabled

func IsTraceEnabled() bool

IsTraceEnabled returns config value from key boost.factory.otel.enabled where default is true.

func NewGPRCMeterExporter

func NewGPRCMeterExporter(ctx context.Context, options *Options) (sdkmetric.Exporter, error)

func NewGRPCTracerExporter

func NewGRPCTracerExporter(ctx context.Context, options *Options) (*otlptrace.Exporter, error)

func NewHTTPMeterExporter

func NewHTTPMeterExporter(ctx context.Context, options *Options) (sdkmetric.Exporter, error)

func NewHTTPTracerExporter

func NewHTTPTracerExporter(ctx context.Context, options *Options) (*otlptrace.Exporter, error)

func NewMeter

func NewMeter(name string, options ...metric.MeterOption) metric.Meter

NewMeter creates a Metric with the provided name and options. A Meter allows for the custom instrumentation.

StartMeterProvider should be called before to setup the meter provider, otherwise a Noop tracer provider will be used.

func NewMeterExporter

func NewMeterExporter(ctx context.Context, options *Options) (sdkmetric.Exporter, error)

func NewReader

func NewReader(options *Options, exporter sdkmetric.Exporter) *sdkmetric.PeriodicReader

func NewResource

func NewResource(ctx context.Context, options *Options) (*resource.Resource, error)

func NewTracer

func NewTracer(name string, options ...trace.TracerOption) trace.Tracer

NewTracer creates a Tracer with the provided name and options. A Tracer allows the creation of spans for custom instrumentation.

StartTracerProvider should be called before to setup the tracer provider, otherwise a Noop tracer provider will be used.

func NewTracerExporter

func NewTracerExporter(ctx context.Context, options *Options) (*otlptrace.Exporter, error)

func Service

func Service() string

Service returns config value from key boost.factory.otel.service where default is empty.

func StartMeterProvider

func StartMeterProvider(ctx context.Context, startOptions ...sdkmetric.Option)

StartMeterProvider starts the tracer provider like StartMetricProviderWithOptions but with default Options.

func StartMetricProviderWithOptions

func StartMetricProviderWithOptions(ctx context.Context, options *Options, startOptions ...sdkmetric.Option)

StartMetricProviderWithOptions starts the tracer provider with the given set of options. Calling it multiple times will have no effect. If an error occours during tracer initialization, a Noop trace provider will be used instead.

func StartTracerProvider

func StartTracerProvider(ctx context.Context, startOptions ...sdktrace.TracerProviderOption)

StartTracerProvider starts the tracer provider like StartMetricProviderWithOptions but with default Options.

func StartTracerProviderWithOptions

func StartTracerProviderWithOptions(ctx context.Context, options *Options, startOptions ...sdktrace.TracerProviderOption)

StartTracerProviderWithOptions starts the tracer provider with the given set of options. Calling it multiple times will have no effect. If an error occours during tracer initialization, a Noop trace provider will be used instead.

Types

type Options

type Options struct {
	Enabled bool
	Service string
	Env     string
	Version string
	Export  struct {
		Interval time.Duration
		Timeout  time.Duration
	}
	Protocol string
	Endpoint string
	Insecure bool
	Tags     map[string]string
	TLS      struct {
		Cert string
	}
}

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

NewOptionsWithPath unmarshals options based on a given key path.

Jump to

Keyboard shortcuts

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