Documentation ¶
Overview ¶
Package adapters is for data conversion.
Index ¶
- Variables
- func ConfigFromString(configStr string) (map[interface{}]interface{}, error)
- func ConfigToContainerProbe(config map[interface{}]interface{}) (*corev1.Probe, error)
- func ConfigToExporterPorts(logger logr.Logger, config map[interface{}]interface{}) ([]corev1.ServicePort, error)
- func ConfigToMetricsPort(logger logr.Logger, config map[interface{}]interface{}) (int32, error)
- func ConfigToPorts(logger logr.Logger, config map[interface{}]interface{}) []corev1.ServicePort
- func ConfigToReceiverPorts(logger logr.Logger, config map[interface{}]interface{}) ([]corev1.ServicePort, error)
- func GetEnabledExporters(_ logr.Logger, config map[interface{}]interface{}) map[interface{}]bool
- func GetEnabledReceivers(_ logr.Logger, config map[interface{}]interface{}) map[interface{}]bool
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoExporters indicates that there are no exporters in the configuration. ErrNoExporters = errors.New("no exporters available as part of the configuration") // 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") // ErrExportersNotAMap indicates that the exporters property isn't a map of values. ErrExportersNotAMap = errors.New("exporters property in the configuration doesn't contain valid exporters") )
var ( ErrNoServiceExtensions = errors.New("service property in the configuration doesn't contain extensions") ErrNoServiceExtensionHealthCheck = errors.New("no healthcheck extension available in service extension configuration") )
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 ¶
ConfigFromString extracts a configuration map from the given string. If the given string isn't a valid YAML, ErrInvalidYAML is returned.
func ConfigToContainerProbe ¶
ConfigToContainerProbe converts the incoming configuration object into a container probe or returns an error.
func ConfigToExporterPorts ¶ added in v0.84.0
func ConfigToExporterPorts(logger logr.Logger, config map[interface{}]interface{}) ([]corev1.ServicePort, error)
ConfigToExporterPorts converts the incoming configuration object into a set of service ports required by the exporters.
func ConfigToMetricsPort ¶
ConfigToMetricsPort gets the port number for the metrics endpoint from the collector config if it has been set.
func ConfigToPorts ¶ added in v0.84.0
func ConfigToPorts(logger logr.Logger, config map[interface{}]interface{}) []corev1.ServicePort
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 GetEnabledExporters ¶ added in v0.84.0
func GetEnabledReceivers ¶
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.