adapters

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package adapters is for data conversion.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidYAML represents an error in the format of the configuration file.
	ErrInvalidYAML = errors.New("couldn't parse the yaml configuration")
	ErrInvalidJSON = errors.New("couldn't parse cloudwatch agent json configuration")
)
View Source
var (
	ErrNoServiceExtensions = errors.New("service property in the configuration doesn't contain extensions")

	ErrNoServiceExtensionHealthCheck = errors.New("no healthcheck extension available in service extension configuration")
)

Functions

func ConfigFromJSONString

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

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

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

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

func ConfigToMetricsPort

func ConfigToMetricsPort(logger logr.Logger, config map[interface{}]interface{}) (int32, error)

ConfigToMetricsPort gets the port number for the metrics endpoint from the collector config if it has been set.

Types

type AppSignals added in v1.2.1

type AppSignals struct {
	TLS *TLS `json:"tls,omitempty"`
}

type ComponentType

type ComponentType int
const (
	ComponentTypeReceiver ComponentType = iota
	ComponentTypeExporter
)

func (ComponentType) String

func (c ComponentType) String() string

type CwaConfig

type CwaConfig struct {
	Metrics *Metrics `json:"metrics,omitempty"`
	Logs    *Logs    `json:"logs,omitempty"`
	Traces  *Traces  `json:"traces,omitempty"`
}

func ConfigStructFromJSONString

func ConfigStructFromJSONString(configStr string) (*CwaConfig, error)

func (*CwaConfig) GetApplicationSignalsConfig added in v1.2.1

func (c *CwaConfig) GetApplicationSignalsConfig() *AppSignals

type LogMetricsCollected added in v1.2.1

type LogMetricsCollected struct {
	EMF                *emf        `json:"emf,omitempty"`
	ApplicationSignals *AppSignals `json:"application_signals,omitempty"`
	AppSignals         *AppSignals `json:"app_signals,omitempty"`
	Kubernetes         *kubernetes `json:"kubernetes,omitempty"`
}

type Logs added in v1.2.1

type Logs struct {
	LogMetricsCollected *LogMetricsCollected `json:"metrics_collected,omitempty"`
}

type Metrics added in v1.2.1

type Metrics struct {
	MetricsCollected *MetricsCollected `json:"metrics_collected,omitempty"`
}

type MetricsCollected added in v1.2.1

type MetricsCollected struct {
	StatsD   *statsD   `json:"statsd,omitempty"`
	CollectD *collectD `json:"collectd,omitempty"`
}

type TLS added in v1.2.1

type TLS struct {
	CertFile string `json:"cert_file,omitempty"`
	KeyFile  string `json:"key_file,omitempty"`
}

type Traces added in v1.2.1

type Traces struct {
	TracesCollected *TracesCollected `json:"traces_collected,omitempty"`
}

type TracesCollected added in v1.2.1

type TracesCollected struct {
	XRay *xray `json:"xray,omitempty"`
	OTLP *otlp `json:"otlp,omitempty"`
}

Jump to

Keyboard shortcuts

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