config

package
v0.100.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFlagSet

func GetFlagSet(errorHandling pflag.ErrorHandling) *pflag.FlagSet

func GetLogger

func GetLogger() logr.Logger

func LoadFromCLI

func LoadFromCLI(target *Config, flagSet *pflag.FlagSet) error

func LoadFromFile

func LoadFromFile(cfg *Config, configFile string) error

Types

type Capability

type Capability string
const (
	Unspecified                    Capability = "Unspecified"
	ReportsStatus                  Capability = "ReportsStatus"
	AcceptsRemoteConfig            Capability = "AcceptsRemoteConfig"
	ReportsEffectiveConfig         Capability = "ReportsEffectiveConfig"
	AcceptsPackages                Capability = "AcceptsPackages"
	ReportsPackageStatuses         Capability = "ReportsPackageStatuses"
	ReportsOwnTraces               Capability = "ReportsOwnTraces"
	ReportsOwnMetrics              Capability = "ReportsOwnMetrics"
	ReportsOwnLogs                 Capability = "ReportsOwnLogs"
	AcceptsOpAMPConnectionSettings Capability = "AcceptsOpAMPConnectionSettings"
	AcceptsOtherConnectionSettings Capability = "AcceptsOtherConnectionSettings"
	AcceptsRestartCommand          Capability = "AcceptsRestartCommand"
	ReportsHealth                  Capability = "ReportsHealth"
	ReportsRemoteConfig            Capability = "ReportsRemoteConfig"
)

type Config

type Config struct {
	// KubeConfigFilePath is empty if InClusterConfig() should be used, otherwise it's a path to where a valid
	// kubernetes configuration file.
	KubeConfigFilePath string       `yaml:"kubeConfigFilePath,omitempty"`
	ListenAddr         string       `yaml:"listenAddr,omitempty"`
	ClusterConfig      *rest.Config `yaml:"-"`
	RootLogger         logr.Logger  `yaml:"-"`

	// ComponentsAllowed is a list of allowed OpenTelemetry components for each pipeline type (receiver, processor, etc.)
	ComponentsAllowed map[string][]string `yaml:"componentsAllowed,omitempty"`
	Endpoint          string              `yaml:"endpoint"`
	Headers           Headers             `yaml:"headers,omitempty"`
	Capabilities      map[Capability]bool `yaml:"capabilities"`
	HeartbeatInterval time.Duration       `yaml:"heartbeatInterval,omitempty"`
	Name              string              `yaml:"name,omitempty"`
}

func Load

func Load(logger logr.Logger, flagSet *pflag.FlagSet) (*Config, error)

func NewConfig

func NewConfig(logger logr.Logger) *Config

func (*Config) CreateClient

func (c *Config) CreateClient() opampclient.OpAMPClient

func (*Config) GetAgentScheme

func (c *Config) GetAgentScheme() string

func (*Config) GetAgentType

func (c *Config) GetAgentType() string

func (*Config) GetAgentVersion

func (c *Config) GetAgentVersion() string

func (*Config) GetCapabilities

func (c *Config) GetCapabilities() protobufs.AgentCapabilities

func (*Config) GetComponentsAllowed

func (c *Config) GetComponentsAllowed() map[string]map[string]bool

func (*Config) GetDescription

func (c *Config) GetDescription() *protobufs.AgentDescription

func (*Config) GetKubernetesClient

func (c *Config) GetKubernetesClient() (client.Client, error)

func (*Config) GetNewInstanceId

func (c *Config) GetNewInstanceId() ulid.ULID

func (*Config) RemoteConfigEnabled

func (c *Config) RemoteConfigEnabled() bool

type Headers

type Headers map[string]string

func (Headers) ToHTTPHeader

func (h Headers) ToHTTPHeader() http.Header

Jump to

Keyboard shortcuts

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