Documentation ¶
Overview ¶
Package common provides a set of common symbols needed by different packages, to avoid circular dependencies.
Package common provides a set of common symbols needed by different packages, to avoid circular dependencies.
Index ¶
- Constants
- Variables
- func GetDistPath() string
- func GetPythonPaths() []string
- func GetVersion(w http.ResponseWriter, r *http.Request)
- func GetViewsPath() string
- func ImportConfig(oldConfigDir string, newConfigDir string, force bool) error
- func LoadComponents(confdPath string)
- func NewSettingsClient() (settings.Client, error)
- func SelectedCheckMatcherBuilder(checkNames []string, minInstances uint) func(configs []integration.Config) bool
- func SetupConfig(confFilePath string) error
- func SetupConfigIfExist(confFilePath string) error
- func SetupConfigWithWarnings(confFilePath, configName string) (*config.Warnings, error)
- func SetupConfigWithoutSecrets(confFilePath string, configName string) error
- func SetupSystemProbeConfig(sysProbeConfFilePath string) error
- func StartAutoConfig()
- func WaitForConfigs(retryInterval, timeout time.Duration, ...) []integration.Config
- type TransformationFunc
Constants ¶
const ( // DefaultConfPath points to the folder containing datadog.yaml DefaultConfPath = "/etc/datadog-agent" // DefaultLogFile points to the log file that will be used if not configured DefaultLogFile = "/var/log/datadog/agent.log" // DefaultDCALogFile points to the log file that will be used if not configured DefaultDCALogFile = "/var/log/datadog/cluster-agent.log" //DefaultJmxLogFile points to the jmx fetch log file that will be used if not configured DefaultJmxLogFile = "/var/log/datadog/jmxfetch.log" // DefaultCheckFlareDirectory a flare friendly location for checks to be written DefaultCheckFlareDirectory = "/var/log/datadog/checks/" // DefaultJMXFlareDirectory a flare friendly location for jmx command logs to be written DefaultJMXFlareDirectory = "/var/log/datadog/jmxinfo/" )
Variables ¶
var ( // AC is the global object orchestrating checks' loading and running AC *autodiscovery.AutoConfig // Coll is the global collector instance Coll *collector.Collector // DSD is the global dogstatsd instance DSD *dogstatsd.Server // OTLP is the global OTLP pipeline instance OTLP *otlp.Pipeline // MetadataScheduler is responsible to orchestrate metadata collection MetadataScheduler *metadata.Scheduler // Forwarder is the global forwarder instance Forwarder forwarder.Forwarder // MainCtx is the main agent context passed to components MainCtx context.Context // MainCtxCancel cancels the main agent context MainCtxCancel context.CancelFunc )
var ( // PyChecksPath holds the path to the python checks from integrations-core shipped with the agent PyChecksPath = filepath.Join(_here, "..", "..", "checks.d") )
Functions ¶
func GetDistPath ¶
func GetDistPath() string
GetDistPath returns the fully qualified path to the 'dist' directory
func GetPythonPaths ¶
func GetPythonPaths() []string
GetPythonPaths returns the paths (in order of precedence) from where the agent should load python modules and checks
func GetVersion ¶
func GetVersion(w http.ResponseWriter, r *http.Request)
GetVersion returns the version of the agent in a http response json
func GetViewsPath ¶
func GetViewsPath() string
GetViewsPath returns the fully qualified path to the 'gui/views' directory
func ImportConfig ¶
ImportConfig imports the agent5 configuration into the agent6 yaml config
func LoadComponents ¶
func LoadComponents(confdPath string)
LoadComponents configures several common Agent components: tagger, collector, scheduler and autodiscovery
func NewSettingsClient ¶
NewSettingsClient returns a configured runtime settings client.
func SelectedCheckMatcherBuilder ¶
func SelectedCheckMatcherBuilder(checkNames []string, minInstances uint) func(configs []integration.Config) bool
SelectedCheckMatcherBuilder returns a function that returns true if the number of configs found for the check name is more or equal to min instances
func SetupConfig ¶
SetupConfig fires up the configuration system
func SetupConfigIfExist ¶
SetupConfigIfExist fires up the configuration system but doesn't raise an error if the configuration file is the default one and it doesn't exist.
func SetupConfigWithWarnings ¶
SetupConfigWithWarnings fires up the configuration system and returns warnings if any.
func SetupConfigWithoutSecrets ¶
SetupConfigWithoutSecrets fires up the configuration system without secrets support
func SetupSystemProbeConfig ¶
SetupSystemProbeConfig returns nil on unsupported builds
func WaitForConfigs ¶
func WaitForConfigs(retryInterval, timeout time.Duration, checkMatcher func([]integration.Config) bool) []integration.Config
WaitForConfigs retries the collection of Autodiscovery configs until the checkMatcher function (which defines whether the list of integration configs collected is sufficient) returns true or the timeout is reached. Autodiscovery listeners run asynchronously, AC.GetAllConfigs() can fail at the beginning to resolve templated configs depending on non-deterministic factors (system load, network latency, active Autodiscovery listeners and their configurations). This function improves the resiliency of the check command. Note: If the check corresponds to a non-template configuration it should be found on the first try and fast-returned.
Types ¶
type TransformationFunc ¶
TransformationFunc type represents transformation applicable to byte slices