config

package module
v0.73.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 15 Imported by: 28

Documentation

Overview

Package config implements a component to handle agent configuration. This component temporarily wraps pkg/config.

This component initializes pkg/config based on the bundle params, and will return the same results as that package. This is to support migration to a component architecture. When no code still uses pkg/config, that package will be removed.

Index

Constants

View Source
const (
	// DefaultConfPath points to the folder containing datadog.yaml
	DefaultConfPath = "/etc/datadog-agent"
)

Variables

This section is empty.

Functions

func GetInstallPath added in v0.73.0

func GetInstallPath() string

GetInstallPath returns the install path for the agent

func Module

func Module() fxutil.Module

Module defines the fx options for this component.

func WithCLIOverride added in v0.58.0

func WithCLIOverride(setting string, value interface{}) func(*Params)

WithCLIOverride registers a list of settings overrides from the CLI for the configuration. The map associate settings name like "logs_config.enabled" to its value.

func WithConfFilePath

func WithConfFilePath(confFilePath string) func(*Params)

WithConfFilePath returns an option which sets ConfFilePath

func WithConfigLoadSecurityAgent

func WithConfigLoadSecurityAgent(configLoadSecurityAgent bool) func(*Params)

WithConfigLoadSecurityAgent returns an option which sets configLoadSecurityAgent

func WithConfigName

func WithConfigName(name string) func(*Params)

WithConfigName returns an option which sets the config name

func WithExtraConfFiles added in v0.56.0

func WithExtraConfFiles(extraConfFilePath []string) func(*Params)

WithExtraConfFiles returns an option which sets ConfFilePath

func WithFleetPoliciesDirPath added in v0.57.0

func WithFleetPoliciesDirPath(fleetPoliciesDirPath string) func(*Params)

WithFleetPoliciesDirPath returns an option which sets FleetPoliciesDirPath

func WithIgnoreErrors

func WithIgnoreErrors(v bool) func(*Params)

WithIgnoreErrors returns an option which sets ignoreErrors

func WithSecurityAgentConfigFilePaths

func WithSecurityAgentConfigFilePaths(securityAgentConfigFilePaths []string) func(*Params)

WithSecurityAgentConfigFilePaths returns an option which sets securityAgentConfigFilePaths

Types

type Component

type Component interface {
	pkgconfigmodel.ReaderWriter

	// Warnings returns config warnings collected during setup.
	Warnings() *pkgconfigmodel.Warnings
}

Component is the component type.

func NewServerlessConfig

func NewServerlessConfig(path string) (Component, error)

NewServerlessConfig initializes a config component from the given config file TODO: serverless must be eventually migrated to fx, this workaround will then become obsolete - ts should not be created directly in this fashion.

type Params

type Params struct {
	// ConfFilePath is the path at which to look for configuration, usually
	// given by the --cfgpath command-line flag.
	ConfFilePath string

	// ExtraConfFilePath represents the paths to additional configuration files to be merged over the main datadog.yaml.
	// Usually given by the --extracfgpath command-line flag.
	ExtraConfFilePath []string

	// FleetPoliciesDirPath is the path at which to look for remote configuration files
	FleetPoliciesDirPath string
	// contains filtered or unexported fields
}

Params defines the parameters for the config component.

func NewAgentParams

func NewAgentParams(confFilePath string, options ...func(*Params)) Params

NewAgentParams creates a new instance of Params for the Agent.

func NewClusterAgentParams

func NewClusterAgentParams(configFilePath string, options ...func(*Params)) Params

NewClusterAgentParams returns a new Params struct for the cluster agent

func NewParams

func NewParams(defaultConfPath string, options ...func(*Params)) Params

NewParams creates a new instance of Params

func NewSecurityAgentParams

func NewSecurityAgentParams(securityAgentConfigFilePaths []string, options ...func(*Params)) Params

NewSecurityAgentParams creates a new instance of Params for the Security Agent.

type Reader

type Reader = pkgconfigmodel.Reader //nolint:revive

Reader is a subset of Config that only allows reading of configuration

Jump to

Keyboard shortcuts

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