adapters

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package adapters is for data conversion.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoReceivers indicates that there are no receivers in the configuration.
	ErrNoReceivers = errors.New("no receivers available as part of the configuration")

	// ErrReceiversNotAMap indicates that the receivers property isn't a map of values.
	ErrReceiversNotAMap = errors.New("receivers property in the configuration doesn't contain valid receivers")
)
View Source
var (
	// ErrInvalidYAML represents an error in the format of the configuration file.
	ErrInvalidYAML = errors.New("couldn't parse the opentelemetry-collector configuration")
)

Functions

func ConfigFromString

func ConfigFromString(configStr string) (map[interface{}]interface{}, error)

ConfigFromString extracts a configuration map from the given string. If the given string isn't a valid YAML, ErrInvalidYAML is returned.

func ConfigToContainerProbe added in v0.40.0

func ConfigToContainerProbe(config map[interface{}]interface{}) (*corev1.Probe, error)

ConfigToContainerProbe converts the incoming configuration object into a container probe or returns an error.

func ConfigToReceiverPorts

func ConfigToReceiverPorts(logger logr.Logger, config map[interface{}]interface{}) ([]corev1.ServicePort, error)

ConfigToReceiverPorts converts the incoming configuration object into a set of service ports required by the receivers.

func GetEnabledReceivers added in v0.49.0

func GetEnabledReceivers(_ logr.Logger, config map[interface{}]interface{}) map[interface{}]bool

Following Otel Doc: Configuring a receiver does not enable it. The receivers are enabled via pipelines within the service section. GetEnabledReceivers returns all enabled receivers as a true flag set. If it can't find any receiver, it will return a nil interface.

Types

This section is empty.

Jump to

Keyboard shortcuts

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