Documentation ¶
Index ¶
- func GetRegisteredFactoryKeys() []string
- func RegisterCheck(name string, c CheckFactory)
- type CheckBase
- func (c *CheckBase) BuildID(instance, initConfig check.ConfigData)
- 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) 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
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.
func NewCheckBase ¶
NewCheckBase returns a check base struct with a given check name
func (*CheckBase) BuildID ¶
func (c *CheckBase) BuildID(instance, initConfig check.ConfigData)
BuildID is to be called by the check's Config() method to generate the unique check ID.
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)
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 ¶
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 network provides core checks for networking
|
Package network provides core checks for networking |