telemetry

package
v0.119.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 25 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logs    LogsConfig    `mapstructure:"logs"`
	Metrics MetricsConfig `mapstructure:"metrics"`
	Traces  TracesConfig  `mapstructure:"traces"`

	// Resource specifies user-defined attributes to include with all emitted telemetry.
	// Note that some attributes are added automatically (e.g. service.version) even
	// if they are not specified here. In order to suppress such attributes the
	// attribute must be specified in this map with null YAML value (nil string pointer).
	Resource map[string]*string `mapstructure:"resource"`
}

Config defines the configurable settings for service telemetry.

func (*Config) Unmarshal added in v0.111.0

func (c *Config) Unmarshal(conf *confmap.Conf) error

func (*Config) Validate

func (c *Config) Validate() error

Validate checks whether the current configuration is valid

type Factory added in v0.102.0

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, log.LoggerProvider, 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 added in v0.102.0

func NewFactory() Factory

NewFactory creates a new Factory.

type LogsConfig

type LogsConfig = migration.LogsConfigV030

LogsConfig defines the configurable settings for service telemetry logs. This MUST be compatible with zap.Config. Cannot use directly zap.Config because the collector uses mapstructure and not yaml tags.

type LogsSamplingConfig

type LogsSamplingConfig = migration.LogsSamplingConfig

LogsSamplingConfig sets a sampling strategy for the logger. Sampling caps the global CPU and I/O load that logging puts on your process while attempting to preserve a representative subset of your logs.

type MetricsConfig

type MetricsConfig = migration.MetricsConfigV030

MetricsConfig exposes the common Telemetry configuration for one component. Experimental: *NOTE* this structure is subject to change or removal in the future.

type Settings

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

Settings holds configuration for building Telemetry.

type TracesConfig

type TracesConfig = migration.TracesConfigV030

TracesConfig exposes the common Telemetry configuration for collector's internal spans. Experimental: *NOTE* this structure is subject to change or removal in the future.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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