global

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug added in v1.3.0

func Debug(msg string, keysAndValues ...interface{})

Debug prints messages about all internal changes in the API or SDK.

func Error added in v1.3.0

func Error(err error, msg string, keysAndValues ...interface{})

Error prints messages about exceptional states of the API or SDK.

func GetLogger added in v1.25.0

func GetLogger() logr.Logger

GetLogger returns the global logger.

func Info added in v1.3.0

func Info(msg string, keysAndValues ...interface{})

Info prints messages about the general state of the API or SDK. This should usually be less than 5 messages a minute.

func MeterProvider

func MeterProvider() metric.MeterProvider

MeterProvider is the internal implementation for global.MeterProvider.

func SetErrorHandler added in v1.15.0

func SetErrorHandler(h ErrorHandler)

SetErrorHandler sets the global ErrorHandler to h.

The first time this is called all ErrorHandler previously returned from GetErrorHandler will send errors to h instead of the default logging ErrorHandler. Subsequent calls will set the global ErrorHandler, but not delegate errors to h.

func SetLogger added in v1.3.0

func SetLogger(l logr.Logger)

SetLogger sets the global Logger to l.

To see Warn messages use a logger with `l.V(1).Enabled() == true` To see Info messages use a logger with `l.V(4).Enabled() == true` To see Debug messages use a logger with `l.V(8).Enabled() == true`.

func SetMeterProvider

func SetMeterProvider(mp metric.MeterProvider)

SetMeterProvider is the internal implementation for global.SetMeterProvider.

func SetTextMapPropagator

func SetTextMapPropagator(p propagation.TextMapPropagator)

SetTextMapPropagator is the internal implementation for global.SetTextMapPropagator.

func SetTracerProvider

func SetTracerProvider(tp trace.TracerProvider)

SetTracerProvider is the internal implementation for global.SetTracerProvider.

func TextMapPropagator

func TextMapPropagator() propagation.TextMapPropagator

TextMapPropagator is the internal implementation for global.TextMapPropagator.

func TracerProvider

func TracerProvider() trace.TracerProvider

TracerProvider is the internal implementation for global.TracerProvider.

func Warn added in v1.15.0

func Warn(msg string, keysAndValues ...interface{})

Warn prints messages about warnings in the API or SDK. Not an error but is likely more important than an informational event.

Types

type ErrDelegator added in v1.15.0

type ErrDelegator struct {
	// contains filtered or unexported fields
}

func (*ErrDelegator) Handle added in v1.15.0

func (d *ErrDelegator) Handle(err error)

type ErrorHandler added in v1.15.0

type ErrorHandler interface {
	// Handle handles any error deemed irremediable by an OpenTelemetry
	// component.
	Handle(error)
}

ErrorHandler handles irremediable events.

func GetErrorHandler added in v1.15.0

func GetErrorHandler() ErrorHandler

GetErrorHandler returns the global ErrorHandler instance.

The default ErrorHandler instance returned will log all errors to STDERR until an override ErrorHandler is set with SetErrorHandler. All ErrorHandler returned prior to this will automatically forward errors to the set instance instead of logging.

Subsequent calls to SetErrorHandler after the first will not forward errors to the new ErrorHandler for prior returned instances.

Jump to

Keyboard shortcuts

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