Documentation ¶
Index ¶
- func IsInsecure() bool
- func IsTracerEnabled() bool
- func NewTracer(name string, options ...trace.TracerOption) trace.Tracer
- func Service() string
- func StartTracerProvider(ctx context.Context, startOptions ...sdktrace.TracerProviderOption)
- func StartTracerProviderWithOptions(ctx context.Context, options *Options, ...)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInsecure ¶
func IsInsecure() bool
func IsTracerEnabled ¶
func IsTracerEnabled() bool
IsTracerEnabled returns config value from key boost.opentelemetry.enabled where default is true.
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 Service ¶
func Service() string
Service returns config value from key boost.opentelemetry.service where default is empty.
func StartTracerProvider ¶
func StartTracerProvider(ctx context.Context, startOptions ...sdktrace.TracerProviderOption)
StartTracerProvider starts the tracer provider like StartTracerProviderWithOptions 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 Protocol string Endpoint string Insecure bool Tags map[string]string TLS struct { Cert string } }
func NewOptions ¶
NewOptions returns options from config file or environment vars.
func NewOptionsWithPath ¶
NewOptionsWithPath unmarshals options based on a given key path.