Documentation ¶
Overview ¶
Package config implements a component to handle trace-agent configuration. This component temporarily wraps pkg/trace/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.
The mock component does nothing at startup, beginning with an empty config. It also overwrites the pkg/config.SystemProbe for the duration of the test.
Index ¶
Constants ¶
const DefaultLogFilePath = "/var/log/datadog/trace-agent.log"
DefaultLogFilePath is where the agent will write logs if not overridden in the conf
Variables ¶
This section is empty.
Functions ¶
func LoadConfigFile ¶
func LoadConfigFile(path string, c corecompcfg.Component, tagger tagger.Component) (*config.AgentConfig, error)
LoadConfigFile returns a new configuration based on the given path. The path must not necessarily exist and a valid configuration can be returned based on defaults and environment variables. If a valid configuration can not be obtained, an error is returned.
func SetHandler ¶
SetHandler returns handler for runtime configuration changes.
Types ¶
type Component ¶
type Component interface { // Warnings returns config warnings collected during setup. Warnings() *model.Warnings // SetHandler returns a handler for runtime configuration changes. SetHandler() http.Handler // GetConfigHandler returns a handler to fetch the runtime configuration. GetConfigHandler() http.Handler // SetMaxMemCPU SetMaxMemCPU(isContainerized bool) // Object returns wrapped config Object() *traceconfig.AgentConfig // OnUpdateAPIKey registers a callback for API Key changes OnUpdateAPIKey(func(oldKey, newKey string)) }
Component is the component type.
func NewConfig ¶
func NewConfig(deps Dependencies) (Component, error)
NewConfig is the default constructor for the component, it returns a component instance and an error.
type Dependencies ¶
type Dependencies struct { fx.In Params Params Config coreconfig.Component Tagger tagger.Component }
Dependencies defines the trace config component deps. These include the core config configuration and component config params.