Documentation ¶
Index ¶
- func GetRegisteredFactoryKeys() []string
- func RegisterCheck(name string, c CheckFactory)
- type CheckBase
- func (c *CheckBase) BuildID(instance, initConfig integration.Data)
- func (c *CheckBase) CommonConfigure(instance integration.Data) error
- func (c *CheckBase) Configure(data integration.Data, initConfig integration.Data) error
- func (c *CheckBase) GetMetricStats() (map[string]int64, error)
- func (c *CheckBase) GetWarnings() []error
- func (c *CheckBase) ID() check.ID
- func (c *CheckBase) Interval() time.Duration
- func (c *CheckBase) Stop()
- func (c *CheckBase) String() string
- func (c *CheckBase) Version() string
- func (c *CheckBase) Warn(v ...interface{}) error
- func (c *CheckBase) Warnf(format string, params ...interface{}) error
- type CheckFactory
- type GoCheckLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRegisteredFactoryKeys ¶
func GetRegisteredFactoryKeys() []string
GetRegisteredFactoryKeys get the keys for all registered factories
func RegisterCheck ¶
func RegisterCheck(name string, c CheckFactory)
RegisterCheck adds a check to the catalog
Types ¶
type CheckBase ¶
type CheckBase struct {
// contains filtered or unexported fields
}
CheckBase provides default implementations for most of the check.Check interface to make it easier to bootstrap a new corecheck.
To use it, you need to embed it in your check struct, by calling NewCheckBase() in your factory, plus: - long-running checks must override Stop() and Interval() - checks supporting multiple instances must call BuildID() from their Config() method - after optionally building a unique ID, CommonConfigure() must be called from the Config() method to handle the common instance fields
Integration warnings are handled via the Warn and Warnf methods that forward the warning to the logger and send the warning to the collector for display in the status page and the web UI.
If custom tags are set in the instance configuration, they will be automatically appended to each send done by this check.
func NewCheckBase ¶
NewCheckBase returns a check base struct with a given check name
func (*CheckBase) BuildID ¶
func (c *CheckBase) BuildID(instance, initConfig integration.Data)
BuildID is to be called by the check's Config() method to generate the unique check ID.
func (*CheckBase) CommonConfigure ¶
func (c *CheckBase) CommonConfigure(instance integration.Data) error
CommonConfigure is called when checks implement their own Configure method, in order to setup common options (run interval, empty hostname)
func (*CheckBase) Configure ¶
func (c *CheckBase) Configure(data integration.Data, initConfig integration.Data) error
Configure is provided for checks that require no config. If overridden, the call to CommonConfigure must be preserved.
func (*CheckBase) GetMetricStats ¶
GetMetricStats returns the stats from the last run of the check.
func (*CheckBase) GetWarnings ¶
GetWarnings grabs the latest integration warnings for the check.
func (*CheckBase) ID ¶
ID returns a unique ID for that check instance
For checks that only support one instance, the default value is the check name. Regular checks must call BuildID() from Config() to build their ID.
func (*CheckBase) Interval ¶
Interval returns the scheduling time for the check. Long-running checks should override to return 0.
func (*CheckBase) Stop ¶
func (c *CheckBase) Stop()
Stop does nothing by default, you need to implement it in long-running checks (persisting after Run() exits)
func (*CheckBase) Version ¶
Version returns an empty string as Go check can't be updated independently from the agent
type CheckFactory ¶
CheckFactory factory function type to instantiate checks
func GetCheckFactory ¶
func GetCheckFactory(name string) CheckFactory
GetCheckFactory grabs factory for specific check
type GoCheckLoader ¶
type GoCheckLoader struct{}
GoCheckLoader is a specific loader for checks living in this package
func NewGoCheckLoader ¶
func NewGoCheckLoader() (*GoCheckLoader, error)
NewGoCheckLoader creates a loader for go checks
func (*GoCheckLoader) Load ¶
func (gl *GoCheckLoader) Load(config integration.Config) ([]check.Check, error)
Load returns a list of checks, one for every configuration instance found in `config`
func (*GoCheckLoader) String ¶
func (gl *GoCheckLoader) String() string
Directories ¶
Path | Synopsis |
---|---|
Package cluster provides core checks for cluster level checks, used by the Datadog Cluster Agent.
|
Package cluster provides core checks for cluster level checks, used by the Datadog Cluster Agent. |
Package containers provides core checks for containers and orchestrators
|
Package containers provides core checks for containers and orchestrators |
Package net provides core checks for networking
|
Package net provides core checks for networking |