internal

package
v0.107.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateLoggerFunc

type CreateLoggerFunc func(context.Context, Settings, component.Config) (*zap.Logger, error)

CreateLoggerFunc is the equivalent of Factory.CreateLogger.

type CreateMeterProviderFunc added in v0.105.0

type CreateMeterProviderFunc func(context.Context, Settings, component.Config) (metric.MeterProvider, error)

CreateMeterProviderFunc is the equivalent of Factory.CreateMeterProvider.

type CreateTracerProviderFunc

type CreateTracerProviderFunc func(context.Context, Settings, component.Config) (trace.TracerProvider, error)

CreateTracerProviderFunc is the equivalent of Factory.CreateTracerProvider.

type Factory

type Factory interface {
	// CreateDefaultConfig creates the default configuration for the telemetry.
	// TODO: Should we just inherit from component.Factory?
	CreateDefaultConfig() component.Config

	// CreateLogger creates a logger.
	CreateLogger(ctx context.Context, set Settings, cfg component.Config) (*zap.Logger, error)

	// CreateTracerProvider creates a TracerProvider.
	CreateTracerProvider(ctx context.Context, set Settings, cfg component.Config) (trace.TracerProvider, error)

	// CreateMeterProvider creates a MeterProvider.
	CreateMeterProvider(ctx context.Context, set Settings, cfg component.Config) (metric.MeterProvider, error)
	// contains filtered or unexported methods
}

Factory is factory interface for telemetry. This interface cannot be directly implemented. Implementations must use the NewFactory to implement it.

func NewFactory

func NewFactory(createDefaultConfig component.CreateDefaultConfigFunc, options ...FactoryOption) Factory

NewFactory returns a new Factory.

type FactoryOption

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

FactoryOption apply changes to Factory.

func WithLogger

func WithLogger(createLogger CreateLoggerFunc) FactoryOption

WithLogger overrides the default no-op logger.

func WithMeterProvider added in v0.105.0

func WithMeterProvider(createMeterProvider CreateMeterProviderFunc) FactoryOption

WithMeterProvider overrides the default no-op meter provider.

func WithTracerProvider

func WithTracerProvider(createTracerProvider CreateTracerProviderFunc) FactoryOption

WithTracerProvider overrides the default no-op tracer provider.

type Settings added in v0.103.0

type Settings struct {
	BuildInfo         component.BuildInfo
	AsyncErrorChannel chan error
	ZapOptions        []zap.Option
}

Settings holds configuration for building Telemetry.

Jump to

Keyboard shortcuts

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