config

package
v0.0.0-...-baa23e0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

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

View Source
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 Module

func Module() fxutil.Module

Module defines the fx options for this component.

func SetHandler

func SetHandler() http.Handler

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.

type Params

type Params struct {
	// FailIfAPIKeyMissing controls if the Agent should fail if the API key is missing from the config.
	FailIfAPIKeyMissing bool
}

Params defines the parameters for the config component.

Jump to

Keyboard shortcuts

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