Documentation ¶
Overview ¶
Package config implements loading of configuration from Viper configuration. The implementation relies on registered factories that allow creating default configuration for each type of receiver/exporter/processor.
Index ¶
- Constants
- func DecodeTypeAndName(key string) (typeStr configmodels.Type, fullName string, err error)
- func Load(v *viper.Viper, factories component.Factories) (*configmodels.Config, error)
- func LoadReceiver(componentConfig *viper.Viper, typeStr configmodels.Type, fullName string, ...) (configmodels.Receiver, error)
- func NewViper() *viper.Viper
- func ValidateConfig(cfg *configmodels.Config, _ *zap.Logger) error
- func ViperSubExact(v *viper.Viper, key string) (*viper.Viper, error)
Constants ¶
const (
// ViperDelimiter is used as the default key delimiter in the default viper instance
ViperDelimiter = "::"
)
Variables ¶
This section is empty.
Functions ¶
func DecodeTypeAndName ¶
func DecodeTypeAndName(key string) (typeStr configmodels.Type, fullName string, err error)
DecodeTypeAndName decodes a key in type[/name] format into type and fullName. fullName is the key normalized such that type and name components have spaces trimmed. The "type" part must be present, the forward slash and "name" are optional. typeStr will be non-empty if err is nil.
func Load ¶
Load loads a Config from Viper. After loading the config, need to check if it is valid by calling `ValidateConfig`.
func LoadReceiver ¶
func LoadReceiver(componentConfig *viper.Viper, typeStr configmodels.Type, fullName string, factory component.ReceiverFactory) (configmodels.Receiver, error)
LoadReceiver loads a receiver config from componentConfig using the provided factories.
func NewViper ¶
Creates a new Viper instance with a different key-delimitor "::" instead of the default ".". This way configs can have keys that contain ".".
func ValidateConfig ¶
func ValidateConfig(cfg *configmodels.Config, _ *zap.Logger) error
ValidateConfig validates config.
func ViperSubExact ¶ added in v0.10.0
Copied from the Viper but changed to use the same delimiter and return error if the sub is not a map. See https://github.com/spf13/viper/issues/871
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package configcheck has checks to be applied to configuration objects implemented by factories of components used in the OpenTelemetry collector.
|
Package configcheck has checks to be applied to configuration objects implemented by factories of components used in the OpenTelemetry collector. |
configcompression
module
|
|
Package configerror contains the common errors caused by malformed configs.
|
Package configerror contains the common errors caused by malformed configs. |
Package configgrpc defines the gRPC configuration settings.
|
Package configgrpc defines the gRPC configuration settings. |
xconfighttp
Module
|
|
Package configmodels defines the data models for entities.
|
Package configmodels defines the data models for entities. |
configopaque
module
|
|
configretry
module
|
|
internal
module
|