autologs

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(ctx context.Context, loggerProvider log.LoggerProvider, teeCore bool) (context.Context, error)

Setup OpenTelemetry to zap logger bridge.

Types

type LookupExporter added in v0.16.0

type LookupExporter func(ctx context.Context, name string) (sdklog.Exporter, bool, error)

LookupExporter creates exporter by name.

type Option added in v0.16.0

type Option interface {
	// contains filtered or unexported methods
}

Option applies a configuration option value to a LoggerProvider.

func WithLookupExporter added in v0.16.0

func WithLookupExporter(lookup LookupExporter) Option

WithLookupExporter sets exporter lookup function.

func WithResource added in v0.16.0

func WithResource(res *resource.Resource) Option

WithResource associates a Resource with a LoggerProvider. This Resource represents the entity producing telemetry and is associated with all Meters the LoggerProvider will create.

By default, if this Option is not used, the default Resource from the go.opentelemetry.io/otel/sdk/resource package will be used.

func WithWriter added in v0.16.0

func WithWriter(out io.Writer) Option

WithWriter sets writer for the stderr, stdout exporters.

type ShutdownFunc added in v0.16.0

type ShutdownFunc func(ctx context.Context) error

ShutdownFunc is a function that shuts down the MeterProvider.

func NewLoggerProvider added in v0.16.0

func NewLoggerProvider(ctx context.Context, options ...Option) (
	meterProvider log.LoggerProvider,
	meterShutdown ShutdownFunc,
	err error,
)

NewLoggerProvider initializes new log.LoggerProvider with the given options from environment variables.

Jump to

Keyboard shortcuts

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