Documentation ¶
Index ¶
- func GetRegisteredFactoryKeys() []string
- func RegisterCheck(name string, c CheckFactory)
- type CheckBase
- func (c *CheckBase) BuildID(instance, initConfig integration.Data)
- func (c *CheckBase) Cancel()
- func (c *CheckBase) CommonCancel()
- func (c *CheckBase) CommonConfigure(instance integration.Data, source string) error
- func (c *CheckBase) ConfigSource() string
- func (c *CheckBase) Configure(data integration.Data, initConfig integration.Data, source string) error
- func (c *CheckBase) GetSenderStats() (check.SenderStats, error)
- func (c *CheckBase) GetWarnings() []error
- func (c *CheckBase) ID() check.ID
- func (c *CheckBase) Interval() time.Duration
- func (c *CheckBase) IsTelemetryEnabled() bool
- 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 Configure() 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 NewCheckBaseWithInterval ¶
NewCheckBaseWithInterval returns a check base struct with a given check name and interval
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) Cancel ¶ added in v0.9.0
func (c *CheckBase) Cancel()
Cancel calls CommonCancel by default. Override it if your check has background resources that need to be cleaned up when the check is unscheduled. Make sure to call CommonCancel from your override.
func (*CheckBase) CommonCancel ¶ added in v0.9.0
func (c *CheckBase) CommonCancel()
CommonCancel cleans up common resources. Must be called from Cancel when checks implement it.
func (*CheckBase) CommonConfigure ¶
func (c *CheckBase) CommonConfigure(instance integration.Data, source string) error
CommonConfigure is called when checks implement their own Configure method, in order to setup common options (run interval, empty hostname)
func (*CheckBase) ConfigSource ¶
ConfigSource returns an empty string as Go check can't be updated independently from the agent
func (*CheckBase) Configure ¶
func (c *CheckBase) Configure(data integration.Data, initConfig integration.Data, source string) error
Configure is provided for checks that require no config. If overridden, the call to CommonConfigure must be preserved.
func (*CheckBase) GetSenderStats ¶ added in v0.9.0
func (c *CheckBase) GetSenderStats() (check.SenderStats, error)
GetSenderStats 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) IsTelemetryEnabled ¶
IsTelemetryEnabled returns if the telemetry is enabled for this check.
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, instance integration.Data) (check.Check, error)
Load returns a Go check
func (*GoCheckLoader) Name ¶ added in v0.9.0
func (gl *GoCheckLoader) Name() string
Name return returns Go loader name
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 |
nvidia
|
|
jetson
Package nvidia provides core checks for Nvidia's jetson device family
|
Package nvidia provides core checks for Nvidia's jetson device family |
Package system provides core checks for OS-level system metrics
|
Package system provides core checks for OS-level system metrics |
Package systemd provides core checks for systemd
|
Package systemd provides core checks for systemd |