otel

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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 ignite.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 ignite.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

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