setup

package module
v0.83.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 31 Imported by: 19

Documentation

Overview

Package setup defines the configuration of the agent

Package setup defines the configuration of the agent

Package setup defines the configuration of the agent

Index

Constants

View Source
const (

	// DefaultRuntimePoliciesDir is the default policies directory used by the runtime security module
	DefaultRuntimePoliciesDir = "/etc/datadog-agent/runtime-security.d"

	// Traces specifies the data type used for Vector override. See https://vector.dev/docs/reference/configuration/sources/datadog_agent/ for additional details.
	Traces string = "traces"
)
View Source
const (
	// Metrics type covers series & sketches
	Metrics string = "metrics"
	// Logs type covers all outgoing logs
	Logs string = "logs"
)
View Source
const (
	// DefaultAuditorTTL is an alias of constants.DefaultAuditorTTL
	DefaultAuditorTTL = constants.DefaultAuditorTTL
	// DefaultBatchMaxContentSize is an alias of constants.DefaultBatchMaxContentSize
	DefaultBatchMaxContentSize = constants.DefaultBatchMaxContentSize
	// DefaultBatchMaxSize is an alias of constants.DefaultBatchMaxSize
	DefaultBatchMaxSize = constants.DefaultBatchMaxSize
	// DefaultForwarderRecoveryInterval is an alias of constants.DefaultForwarderRecoveryInterval
	DefaultForwarderRecoveryInterval = constants.DefaultForwarderRecoveryInterval
	// DefaultInputChanSize is an alias of constants.DefaultInputChanSize
	DefaultInputChanSize = constants.DefaultInputChanSize
	// DefaultLogsSenderBackoffBase is an alias of constants.DefaultLogsSenderBackoffBase
	DefaultLogsSenderBackoffBase = constants.DefaultLogsSenderBackoffBase
	// DefaultLogsSenderBackoffFactor is an alias of constants.DefaultLogsSenderBackoffFactor
	DefaultLogsSenderBackoffFactor = constants.DefaultLogsSenderBackoffFactor
	// DefaultLogsSenderBackoffMax is an alias of constants.DefaultLogsSenderBackoffMax
	DefaultLogsSenderBackoffMax = constants.DefaultLogsSenderBackoffMax
	// DefaultMaxMessageSizeBytes is an alias of constants.DefaultMaxMessageSizeBytes
	DefaultMaxMessageSizeBytes = constants.DefaultMaxMessageSizeBytes
)

These are re-exported here because `opentelemetry-collector-contrib/pkg/datadog/agentcomponents` still reaches for them through `pkgconfigsetup`. Once OTEL is updated they will be removed.

View Source
const (
	OTLPSection                              = "otlp_config"
	OTLPTracePort                            = OTLPSection + ".traces.internal_port"
	OTLPTracesEnabled                        = OTLPSection + ".traces.enabled"
	OTLPTracesInfraAttrEnabled               = OTLPSection + ".traces.infra_attributes.enabled"
	OTLPTracesInfraAttrContainerTagPromotion = OTLPSection + ".traces.infra_attributes.container_tag_promotion"

	OTLPLogs                      = OTLPSection + ".logs"
	OTLPLogsEnabled               = OTLPLogs + ".enabled"
	OTLPLogsInfraAttrTagsAsDDTags = OTLPLogs + ".infra_attributes.tags_as_ddtags"

	OTLPReceiverSubSectionKey = "receiver"
	OTLPReceiverSection       = OTLPSection + "." + OTLPReceiverSubSectionKey

	OTLPMetrics        = OTLPSection + ".metrics"
	OTLPMetricsEnabled = OTLPMetrics + ".enabled"
	OTLPMetricsBatch   = OTLPMetrics + ".batch"

	OTLPDebug = OTLPSection + "." + "debug"

	DataPlaneSection     = "data_plane"
	DataPlaneEnabled     = DataPlaneSection + ".enabled"
	DataPlaneOTLPSection = DataPlaneSection + ".otlp"
	DataPlaneOTLPEnabled = DataPlaneOTLPSection + ".enabled"

	DataPlaneOTLPProxySection = DataPlaneOTLPSection + ".proxy"
	DataPlaneOTLPProxyEnabled = DataPlaneOTLPProxySection + ".enabled"

	DataPlaneOTLPProxyReceiverSection               = DataPlaneOTLPProxySection + ".receiver"
	DataPlaneOTLPProxyReceiverProtocolsGRPCEndpoint = DataPlaneOTLPProxyReceiverSection + ".protocols.grpc.endpoint"
)

OTLP configuration paths.

View Source
const (
	PAREnabled = "private_action_runner.enabled"
	PARLogFile = "private_action_runner.log_file"

	// Identity / enrollment configuration
	PARSelfEnroll             = "private_action_runner.self_enroll"
	PARApiKeyOnlyEnrollment   = "private_action_runner.api_key_only_enrollment"
	PARIdentityFilePath       = "private_action_runner.identity_file_path"
	PARIdentityUseK8sSecret   = "private_action_runner.identity_use_k8s_secret"
	PARIdentitySecretName     = "private_action_runner.identity_secret_name"
	PARPrivateKey             = "private_action_runner.private_key"
	PARUrn                    = "private_action_runner.urn"
	PARSkipConnectionCreation = "private_action_runner.skip_connection_creation"

	// General config
	PARTaskConcurrency       = "private_action_runner.task_concurrency"
	PARTaskTimeoutSeconds    = "private_action_runner.task_timeout_seconds"
	PARActionsAllowlist      = "private_action_runner.actions_allowlist"
	PARDefaultActionsEnabled = "private_action_runner.default_actions_enabled"

	// HTTP Action related
	PARHttpTimeoutSeconds    = "private_action_runner.http_timeout_seconds"
	PARHttpAllowlist         = "private_action_runner.http_allowlist"
	PARHttpAllowImdsEndpoint = "private_action_runner.http_allow_imds_endpoint"

	// Restricted Shell
	PARRestrictedShellAllowedPaths          = "private_action_runner.restricted_shell.allowed_paths"
	PARRestrictedShellAllowedCommands       = "private_action_runner.restricted_shell.allowed_commands"
	PARRestrictedShellAllowedSystemServices = "private_action_runner.restricted_shell.allowed_system_services"
	RShellPathAllowAll                      = "/"
	RShellPathAllowMapContainerizedKey      = "containerized"
	RShellPathAllowMapDefaultKey            = "default"

	// Meant for internal usage
	PAROpmsExtraHeaders = "private_action_runner.opms_extra_headers"
)
View Source
const (
	// DefaultGRPCConnectionTimeoutSecs sets the default value for timeout when connecting to the agent
	DefaultGRPCConnectionTimeoutSecs = 60

	// DefaultProcessQueueSize is the default max amount of process-agent checks that can be buffered in memory if the forwarder can't consume them fast enough (e.g. due to network disruption)
	// This can be fairly high as the input should get throttled by queue bytes first.
	// Assuming we generate ~8 checks/minute (for process/network), this should allow buffering of ~30 minutes of data assuming it fits within the queue bytes memory budget
	DefaultProcessQueueSize = 256

	// DefaultProcessRTQueueSize is the default max amount of process-agent realtime checks that can be buffered in memory
	// We set a small queue size for real-time message because they get staled very quickly, thus we only keep the latest several payloads
	DefaultProcessRTQueueSize = 5

	// DefaultProcessQueueBytes is the default amount of process-agent check data (in bytes) that can be buffered in memory
	// Allow buffering up to 60 megabytes of payload data in total
	DefaultProcessQueueBytes = 60 * 1000 * 1000

	// DefaultProcessMaxPerMessage is the default maximum number of processes, or containers per message. Note: Only change if the defaults are causing issues.
	DefaultProcessMaxPerMessage = 100

	// ProcessMaxPerMessageLimit is the maximum allowed value for maximum number of processes, or containers per message.
	ProcessMaxPerMessageLimit = 10000

	// DefaultProcessMaxMessageBytes is the default max for size of a message containing processes or container data. Note: Only change if the defaults are causing issues.
	DefaultProcessMaxMessageBytes = 1000000

	// ProcessMaxMessageBytesLimit is the maximum allowed value for the maximum size of a message containing processes or container data.
	ProcessMaxMessageBytesLimit = 4000000

	// DefaultProcessExpVarPort is the default port used by the process-agent expvar server
	DefaultProcessExpVarPort = 6062

	// DefaultProcessEntityStreamPort is the default port used by the process-agent to expose Process Entities
	DefaultProcessEntityStreamPort = 6262

	// DefaultProcessEndpoint is the default endpoint for the process agent to send payloads to
	DefaultProcessEndpoint = "https://process.datadoghq.com."

	// DefaultProcessDiscoveryHintFrequency is the default frequency in terms of number of checks which we send a process discovery hint
	DefaultProcessDiscoveryHintFrequency = 60
)

Variables

View Source
var (
	// StartTime is the agent startup time
	StartTime = time.Now()
)

Variables to initialize at start time

Functions

func ApplyUseDogstatsdSuppression added in v0.80.0

func ApplyUseDogstatsdSuppression(config pkgconfigmodel.Config)

ApplyUseDogstatsdSuppression is a post-load override that, when use_dogstatsd is false, forces data_plane.dogstatsd.enabled to false so the Agent Data Plane process (which reads the latter via the config stream) skips its DogStatsD source. data_plane.enabled is intentionally left alone so other ADP pipelines (e.g. OTLP) keep working independently of the DogStatsD master toggle.

It is registered as an override func (runs after datadog.yaml loads) and also called explicitly after fleet policy merging, because fleet policies are applied after the initial override pass.

Matches the truth table at https://github.com/DataDog/saluki/issues/1334#issuecomment-4292253054.

func ComputeDataPlaneStopTimeout added in v0.82.0

func ComputeDataPlaneStopTimeout(config pkgconfigmodel.Config)

ComputeDataPlaneStopTimeout is a post-load override that, when the user has not explicitly set data_plane.stop_timeout, recomputes it from aggregator_stop_timeout + forwarder_stop_timeout. The Agent Data Plane reads this value via the config stream to size its topology graceful-shutdown budget; computing the sum here keeps that budget aligned with the documented core-agent shutdown window even when users customize the component timeouts.

It is registered as an override func (runs after datadog.yaml loads) and also called explicitly after fleet policy merging, because fleet policies are applied after the initial override pass.

func Datadog

func Datadog() pkgconfigmodel.Config

Datadog returns the current agent configuration

func FleetConfigOverride added in v0.68.0

func FleetConfigOverride(_ pkgconfigmodel.Config)

FleetConfigOverride is a no-op on Linux

func GlobalConfigBuilder added in v0.71.0

func GlobalConfigBuilder() pkgconfigmodel.BuildableConfig

GlobalConfigBuilder returns a builder appropriate for initializing the config. It should not be used in most places, except for code that builds the config from scratch.

func GlobalSystemProbeConfigBuilder added in v0.71.0

func GlobalSystemProbeConfigBuilder() pkgconfigmodel.BuildableConfig

GlobalSystemProbeConfigBuilder returns a builder for the system probe config

func InitConfig

func InitConfig(config pkgconfigmodel.Setup)

InitConfig initializes the config defaults on a config used by all agents (in particular more than just the serverless agent).

func InitConfigObjects added in v0.76.0

func InitConfigObjects()

InitConfigObjects initializes the global config objects use across the code. This should never be called anywhere but from the main.

func InitSystemProbeConfig

func InitSystemProbeConfig(cfg pkgconfigmodel.Setup)

InitSystemProbeConfig declares all the configuration values normally read from system-probe.yaml.

func LoadDatadog added in v0.73.0

func LoadDatadog(config pkgconfigmodel.Config, secretResolver secrets.Component, delegatedAuthComp delegatedauth.Component, additionalEnvVars []string) error

LoadDatadog reads config files and initializes config with decrypted secrets

func LoadProxyFromEnv

func LoadProxyFromEnv(config pkgconfigmodel.ReaderWriter)

LoadProxyFromEnv overrides the proxy settings with environment variables

func LoadSystemProbe added in v0.73.0

func LoadSystemProbe(config pkgconfigmodel.Config, additionalKnownEnvVars []string) error

LoadSystemProbe reads config files and initializes config with decrypted secrets for system-probe

func Merge

func Merge(configPaths []string, config pkgconfigmodel.Config) error

Merge will merge additional configuration into an existing configuration

func OTLP

func OTLP(config pkgconfigmodel.Setup)

func ResolveSecrets

func ResolveSecrets(config pkgconfigmodel.Config, secretResolver secrets.Component, origin string) error

ResolveSecrets merges all the secret values from origin into config. Secret values are identified by a value of the form "ENC[key]" where key is the secret key. See: https://github.com/DataDog/datadog-agent/blob/main/docs/agent/secrets.md

It is the exported counterpart of resolveSecrets and may be called by agent binaries that build the config before starting the FX graph (e.g. the otel-agent in standalone mode, where secrets must be resolved so that ENC[] handles in env vars such as DD_HOSTNAME are processed before components like hostnameimpl read the config).

func SanitizeDataPlaneConfig added in v0.82.0

func SanitizeDataPlaneConfig(config pkgconfigmodel.Config)

SanitizeDataPlaneConfig applies sanitizeDataPlaneConfig for the current host. It is also called after fleet policy merging because fleet policies may set process_manager.enabled or data_plane.enabled after the initial LoadDatadog pass.

func SetDatadog added in v0.55.0

func SetDatadog(cfg pkgconfigmodel.BuildableConfig)

SetDatadog sets the the reference to the agent configuration. This is currently used by the legacy converter and config mocks and should not be user anywhere else. Once the legacy converter and mock have been migrated we will remove this function.

func SetSystemProbe added in v0.57.0

func SetSystemProbe(cfg pkgconfigmodel.BuildableConfig)

SetSystemProbe sets the the reference to the systemProbe configuration. This is currently used by the config mocks and should not be user anywhere else. Once the mocks have been migrated we will remove this function.

func SystemProbe

func SystemProbe() pkgconfigmodel.Config

SystemProbe returns the current SystemProbe configuration

Types

type Listeners

type Listeners struct {
	Name             string `mapstructure:"name"`
	EnabledProviders map[string]struct{}
}

Listeners helps unmarshalling `listeners` config param

func (*Listeners) IsProviderEnabled

func (l *Listeners) IsProviderEnabled(provider string) bool

IsProviderEnabled returns whether a config provider is enabled

func (*Listeners) SetEnabledProviders

func (l *Listeners) SetEnabledProviders(ep map[string]struct{})

SetEnabledProviders registers the enabled config providers in the listener config

type UnexpectedUnicodeCodepoint

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

UnexpectedUnicodeCodepoint contains specifics about an occurrence of an unexpected unicode codepoint

func FindUnexpectedUnicode

func FindUnexpectedUnicode(input string) []UnexpectedUnicodeCodepoint

FindUnexpectedUnicode reports any _unexpected_ unicode codepoints found in the given 'input' string Unexpected here generally means invisible whitespace and control chars

Directories

Path Synopsis
constants module

Jump to

Keyboard shortcuts

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