common

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 39 Imported by: 22

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

This section is empty.

Variables

View Source
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
)
View Source
var (
	// DefaultConfPath points to the folder containing datadog.yaml
	DefaultConfPath = "c:\\programdata\\datadog"
	// DefaultLogFile points to the log file that will be used if not configured
	DefaultLogFile = "c:\\programdata\\datadog\\logs\\agent.log"
	// DefaultDCALogFile points to the log file that will be used if not configured
	DefaultDCALogFile = "c:\\programdata\\datadog\\logs\\cluster-agent.log"
	//DefaultJmxLogFile points to the jmx fetch log file that will be used if not configured
	DefaultJmxLogFile = "c:\\programdata\\datadog\\logs\\jmxfetch.log"
	// DefaultCheckFlareDirectory a flare friendly location for checks to be written
	DefaultCheckFlareDirectory = "c:\\programdata\\datadog\\logs\\checks\\"
	// DefaultJMXFlareDirectory a flare friendly location for jmx command logs to be written
	DefaultJMXFlareDirectory = "c:\\programdata\\datadog\\logs\\jmxinfo\\"
)
View Source
var (
	// PyChecksPath holds the path to the python checks from integrations-core shipped with the agent
	PyChecksPath = filepath.Join(_here, "..", "checks.d")
)

Functions

func CheckAndUpgradeConfig

func CheckAndUpgradeConfig() error

CheckAndUpgradeConfig checks to see if there's an old datadog.conf, and if datadog.yaml is either missing or incomplete (no API key). If so, upgrade it

func EnableLoggingToFile

func EnableLoggingToFile()

EnableLoggingToFile -- set up logging to file

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's 'views' directory

func ImportConfig

func ImportConfig(oldConfigDir string, newConfigDir string, force bool) error

ImportConfig imports the agent5 configuration into the agent6 yaml config

func LoadComponents added in v0.9.0

func LoadComponents(confdPath string)

LoadComponents configures several common Agent components: tagger, collector, scheduler and autodiscovery

func NewSettingsClient added in v0.9.0

func NewSettingsClient() (settings.Client, error)

NewSettingsClient returns a configured runtime settings client.

func SetupConfig

func SetupConfig(confFilePath string) error

SetupConfig fires up the configuration system

func SetupConfigIfExist added in v0.9.0

func SetupConfigIfExist(confFilePath string) error

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

func SetupConfigWithWarnings(confFilePath, configName string) (*config.Warnings, error)

SetupConfigWithWarnings fires up the configuration system and returns warnings if any.

func SetupConfigWithoutSecrets

func SetupConfigWithoutSecrets(confFilePath string, configName string) error

SetupConfigWithoutSecrets fires up the configuration system without secrets support

func SetupSystemProbeConfig

func SetupSystemProbeConfig(sysProbeConfFilePath string) error

SetupSystemProbeConfig returns nil on unsupported builds

func StartAutoConfig

func StartAutoConfig()

StartAutoConfig starts auto discovery

Types

type TransformationFunc

type TransformationFunc func(rawData []byte) ([]byte, error)

TransformationFunc type represents transformation applicable to byte slices

Directories

Path Synopsis
path module

Jump to

Keyboard shortcuts

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