otel

package
v1.0.0-dev.138 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MeterProvider metric.MeterProvider
View Source
var TracerProvider trace.TracerProvider

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 NewGRPCMeterExporter

func NewGRPCMeterExporter(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.Reader, error)

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 Logger

type Logger struct {
}

func (Logger) Enabled

func (l Logger) Enabled(level int) bool

func (Logger) Error

func (l Logger) Error(err error, msg string, keysAndValues ...any)

func (Logger) Info

func (l Logger) Info(level int, msg string, keysAndValues ...any)

func (Logger) Init

func (l Logger) Init(info logr.RuntimeInfo)

func (Logger) WithName

func (l Logger) WithName(name string) logr.LogSink

func (Logger) WithValues

func (l Logger) WithValues(keysAndValues ...any) logr.LogSink

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
	Attributes 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