config

package
v0.0.0-...-3264e07 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 91

Documentation

Overview

Package config defines the configuration of the agent

Index

Constants

View Source
const (
	ECSFargate               = env.ECSFargate
	Podman                   = env.Podman
	Docker                   = env.Docker
	EKSFargate               = env.EKSFargate
	ECSEC2                   = env.ECSEC2
	Kubernetes               = env.Kubernetes
	CloudFoundry             = env.CloudFoundry
	Cri                      = env.Cri
	Containerd               = env.Containerd
	KubeOrchestratorExplorer = env.KubeOrchestratorExplorer
	ECSOrchestratorExplorer  = env.ECSOrchestratorExplorer
)

Aliases for constants

Datatype Aliases

View Source
const (
	DefaultForwarderRecoveryInterval         = pkgconfigsetup.DefaultForwarderRecoveryInterval
	DefaultAPIKeyValidationInterval          = pkgconfigsetup.DefaultAPIKeyValidationInterval
	DefaultBatchWait                         = pkgconfigsetup.DefaultBatchWait
	DefaultInputChanSize                     = pkgconfigsetup.DefaultInputChanSize
	DefaultBatchMaxConcurrentSend            = pkgconfigsetup.DefaultBatchMaxConcurrentSend
	DefaultBatchMaxContentSize               = pkgconfigsetup.DefaultBatchMaxContentSize
	DefaultLogsSenderBackoffRecoveryInterval = pkgconfigsetup.DefaultLogsSenderBackoffRecoveryInterval
	DefaultLogsSenderBackoffMax              = pkgconfigsetup.DefaultLogsSenderBackoffMax
	DefaultLogsSenderBackoffFactor           = pkgconfigsetup.DefaultLogsSenderBackoffFactor
	DefaultLogsSenderBackoffBase             = pkgconfigsetup.DefaultLogsSenderBackoffBase
	DefaultBatchMaxSize                      = pkgconfigsetup.DefaultBatchMaxSize
	DefaultNumWorkers                        = pkgconfigsetup.DefaultNumWorkers
	MaxNumWorkers                            = pkgconfigsetup.MaxNumWorkers
	DefaultSite                              = pkgconfigsetup.DefaultSite
	OTLPTracePort                            = pkgconfigsetup.OTLPTracePort
	DefaultAuditorTTL                        = pkgconfigsetup.DefaultAuditorTTL
	DefaultMaxMessageSizeBytes               = pkgconfigsetup.DefaultMaxMessageSizeBytes
	DefaultProcessEntityStreamPort           = pkgconfigsetup.DefaultProcessEntityStreamPort
	DefaultProcessEventsCheckInterval        = pkgconfigsetup.DefaultProcessEventsCheckInterval
	DefaultProcessEventsMinCheckInterval     = pkgconfigsetup.DefaultProcessEventsMinCheckInterval
	ProcessMaxPerMessageLimit                = pkgconfigsetup.ProcessMaxPerMessageLimit
	DefaultProcessMaxPerMessage              = pkgconfigsetup.DefaultProcessMaxPerMessage
	ProcessMaxMessageBytesLimit              = pkgconfigsetup.ProcessMaxMessageBytesLimit
	DefaultProcessDiscoveryHintFrequency     = pkgconfigsetup.DefaultProcessDiscoveryHintFrequency
	DefaultProcessMaxMessageBytes            = pkgconfigsetup.DefaultProcessMaxMessageBytes
	DefaultProcessExpVarPort                 = pkgconfigsetup.DefaultProcessExpVarPort
	DefaultProcessQueueBytes                 = pkgconfigsetup.DefaultProcessQueueBytes
	DefaultProcessQueueSize                  = pkgconfigsetup.DefaultProcessQueueSize
	DefaultProcessRTQueueSize                = pkgconfigsetup.DefaultProcessRTQueueSize
	DefaultRuntimePoliciesDir                = pkgconfigsetup.DefaultRuntimePoliciesDir
	DefaultGRPCConnectionTimeoutSecs         = pkgconfigsetup.DefaultGRPCConnectionTimeoutSecs
	DefaultProcessEndpoint                   = pkgconfigsetup.DefaultProcessEndpoint
	DefaultProcessEventsEndpoint             = pkgconfigsetup.DefaultProcessEventsEndpoint
)

Aliases for config defaults

View Source
const (
	// ClusterIDCacheKey is the key name for the orchestrator cluster id in the agent in-mem cache
	ClusterIDCacheKey = "orchestratorClusterID"
)

Variables

View Source
var (
	IsFeaturePresent             = env.IsFeaturePresent
	IsECS                        = env.IsECS
	IsKubernetes                 = env.IsKubernetes
	IsECSFargate                 = env.IsECSFargate
	IsServerless                 = env.IsServerless
	IsContainerized              = env.IsContainerized
	IsDockerRuntime              = env.IsDockerRuntime
	GetEnvDefault                = env.GetEnvDefault
	IsHostProcAvailable          = env.IsHostProcAvailable
	IsHostSysAvailable           = env.IsHostSysAvailable
	IsAnyContainerFeaturePresent = env.IsAnyContainerFeaturePresent
	GetDetectedFeatures          = env.GetDetectedFeatures
)

environment Aliases

View Source
var (
	// Datadog Alias
	Datadog = pkgconfigsetup.Datadog
	// SystemProbe Alias
	SystemProbe = pkgconfigsetup.SystemProbe
)
View Source
var (
	AddOverride     = model.AddOverride
	AddOverrides    = model.AddOverrides
	AddOverrideFunc = model.AddOverrideFunc
)

Aliases for config overrides

View Source
var (
	NewLogWriter               = logs.NewLogWriter
	ChangeLogLevel             = logs.ChangeLogLevel
	NewTLSHandshakeErrorWriter = logs.NewTLSHandshakeErrorWriter
)

Aliases for logs

View Source
var (
	// IsRemoteConfigEnabled Alias
	IsRemoteConfigEnabled = pkgconfigsetup.IsRemoteConfigEnabled
	// StartTime Alias
	StartTime = pkgconfigsetup.StartTime
	// StandardJMXIntegrations Alias
	StandardJMXIntegrations = pkgconfigsetup.StandardJMXIntegrations
	// SetupOTLP Alias
	SetupOTLP = pkgconfigsetup.OTLP
	// InitSystemProbeConfig Alias
	InitSystemProbeConfig = pkgconfigsetup.InitSystemProbeConfig
	// InitConfig Alias
	InitConfig = pkgconfigsetup.InitConfig

	// GetRemoteConfigurationAllowedIntegrations Alias
	GetRemoteConfigurationAllowedIntegrations = pkgconfigsetup.GetRemoteConfigurationAllowedIntegrations
	// LoadProxyFromEnv Alias
	LoadProxyFromEnv = pkgconfigsetup.LoadProxyFromEnv

	// GetIPCPort Alias
	GetIPCPort = pkgconfigsetup.GetIPCPort
)
View Source
var (
	DefaultUpdaterLogFile       = pkgconfigsetup.DefaultUpdaterLogFile
	DefaultSecurityAgentLogFile = pkgconfigsetup.DefaultSecurityAgentLogFile
	DefaultProcessAgentLogFile  = pkgconfigsetup.DefaultProcessAgentLogFile
	DefaultDDAgentBin           = pkgconfigsetup.DefaultDDAgentBin
)

Aliases to setup package

View Source
var NewConfig = model.NewConfig

NewConfig is alias for Config object.

Functions

func GetBindHost added in v0.9.0

func GetBindHost() string

GetBindHost Alias using Datadog config

func GetBindHostFromConfig

func GetBindHostFromConfig(config model.Reader) string

GetBindHostFromConfig Alias using Datadog config

func GetIPCAddress

func GetIPCAddress() (string, error)

GetIPCAddress Alias using Datadog config

func GetObsPipelineURL

func GetObsPipelineURL(datatype pkgconfigsetup.DataType) (string, error)

GetObsPipelineURL Alias using Datadog config

func GetProcessAPIAddressPort

func GetProcessAPIAddressPort() (string, error)

GetProcessAPIAddressPort Alias using Datadog config

func GetSyslogURI

func GetSyslogURI() string

GetSyslogURI Alias using Datadog config

func GetValidHostAliases added in v0.9.0

func GetValidHostAliases(ctx context.Context) ([]string, error)

GetValidHostAliases Alias using Datadog config

func IsAutoconfigEnabled added in v0.9.0

func IsAutoconfigEnabled() bool

IsAutoconfigEnabled is alias for model.IsAutoconfigEnabled

func IsCLCRunner added in v0.9.0

func IsCLCRunner() bool

IsCLCRunner Alias using Datadog config

func IsCloudProviderEnabled

func IsCloudProviderEnabled(cloudProvider string) bool

IsCloudProviderEnabled Alias using Datadog config

func LoadCustom

func LoadCustom(config model.Config, origin string, secretResolver optional.Option[secrets.Component], additionalKnownEnvVars []string) (*model.Warnings, error)

LoadCustom Alias

func LoadDatadogCustom

func LoadDatadogCustom(config model.Config, origin string, secretResolver optional.Option[secrets.Component], additionalKnownEnvVars []string) (*model.Warnings, error)

LoadDatadogCustom Alias

func LoadWithoutSecret

func LoadWithoutSecret() (*model.Warnings, error)

LoadWithoutSecret Alias using Datadog config

func SetupDogstatsdLogger

func SetupDogstatsdLogger(logFile string) (slog.LoggerInterface, error)

SetupDogstatsdLogger Alias using Datadog config

func SetupJMXLogger added in v0.9.0

func SetupJMXLogger(logFile, syslogURI string, syslogRFC, logToConsole, jsonFormat bool) error

SetupJMXLogger Alias using Datadog config

func SetupLogger

func SetupLogger(loggerName LoggerName, logLevel, logFile, syslogURI string, syslogRFC, logToConsole, jsonFormat bool) error

SetupLogger Alias using Datadog config

Types

type ChangeChecker

type ChangeChecker struct {
	// contains filtered or unexported fields
}

ChangeChecker checks the state of `config.Datadog` did not change between `NewChangeChecker()“ and `HasChanged()`. It is designed to be used in `TestMain` function as follow:

func TestMain(m *testing.M) {
	checker := testutil.NewConfigChangeChecker()
	exit := m.Run()
	if checker.HasChanged() {
		os.Exit(1)
	}
	os.Exit(exit)
}

func NewChangeChecker

func NewChangeChecker() *ChangeChecker

NewChangeChecker creates a new instance of ConfigChangeChecker

func (*ChangeChecker) HasChanged

func (c *ChangeChecker) HasChanged() bool

HasChanged returns whether `config.Datadog` changed since `NewConfigChangeChecker`. If some changes are detected this function displays on the standard error what keys changed.

type Config

type Config = model.Config

Config is alias to model.Config

type ConfigurationProviders

type ConfigurationProviders = pkgconfigsetup.ConfigurationProviders

ConfigurationProviders Alias

type Feature added in v0.9.0

type Feature = env.Feature

Feature Alias

type FeatureMap added in v0.9.0

type FeatureMap = env.FeatureMap

FeatureMap Alias

type LegacyConfigConverter

type LegacyConfigConverter struct {
	Config
}

LegacyConfigConverter is used in the legacy package to convert A5 config to A6

func NewConfigConverter

func NewConfigConverter() *LegacyConfigConverter

NewConfigConverter is creating and returning a config converter

func (*LegacyConfigConverter) Set

func (c *LegacyConfigConverter) Set(key string, value interface{})

Set is used for setting configuration from A5 config

type Listeners

type Listeners = pkgconfigsetup.Listeners

Listeners Alias

type Loader

type Loader = model.Loader

Loader is alias to model.Loader

type LoggerName

type LoggerName = logs.LoggerName

LoggerName Alias

type MappingProfile

type MappingProfile = pkgconfigsetup.MappingProfile

MappingProfile Alias

func GetDogstatsdMappingProfiles

func GetDogstatsdMappingProfiles() ([]MappingProfile, error)

GetDogstatsdMappingProfiles Alias using Datadog config

type MockConfig

type MockConfig struct {
	Config
}

MockConfig should only be used in tests

func Mock

func Mock(t testing.TB) *MockConfig

Mock is creating and returning a mock config

func MockSystemProbe

func MockSystemProbe(t testing.TB) *MockConfig

MockSystemProbe is creating and returning a mock system-probe config

func (*MockConfig) Set

func (c *MockConfig) Set(key string, value interface{}, source model.Source)

Set is used for setting configuration in tests

func (*MockConfig) SetKnown

func (c *MockConfig) SetKnown(key string)

SetKnown is used for setting configuration in tests

func (*MockConfig) SetWithoutSource

func (c *MockConfig) SetWithoutSource(key string, value interface{})

SetWithoutSource is used for setting configuration in tests

type Proxy

type Proxy = model.Proxy

Proxy alias to model.Proxy

type Reader

type Reader = model.Reader

Reader is alias to model.Reader

type ReaderWriter

type ReaderWriter = model.ReaderWriter

ReaderWriter is alias to model.ReaderWriter

type Warnings

type Warnings = model.Warnings

Warnings represent the warnings in the config

type Writer

type Writer = model.Writer

Writer is alias to model.Reader

Directories

Path Synopsis
Package autodiscovery contains helper function that return autodiscovery providers from the config and from the environment where the Agent is running.
Package autodiscovery contains helper function that return autodiscovery providers from the config and from the environment where the Agent is running.
env module
Package fetcher is a collection of high level helpers to pull the configuration from other agent processes
Package fetcher is a collection of high level helpers to pull the configuration from other agent processes
Package legacy contains the logic to convert the old agent configuration
Package legacy contains the logic to convert the old agent configuration
logs module
model module
remote module
Package settings implements runtime settings and profiling
Package settings implements runtime settings and profiling
http
Package http implements helpers for the runtime settings HTTP API
Package http implements helpers for the runtime settings HTTP API
setup module
utils module

Jump to

Keyboard shortcuts

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