package
0.9.0
Repository: https://github.com/datadog/datadog-agent.git
Documentation: pkg.go.dev

# README

package check

This package is responsible of defining the types representing an agent check along with an interface implemented by the code responsible to create a check instance based on an existing configuration.

Check Loaders

Loaders implement the CheckLoader interface, they are responsible to instantiate one object of type check.Check for every configuration instance within a integration.Config object. A Loader usually invokes the Configure method on check objects passing in the configuration instance in YAML format: how to use it, it's up to the check itself.

Usage example:

// given a list of configurations, try to load corresponding checks using different loaders
checks := []check.Check{}
for _, conf := range configs {
  for _, loader := range loaders {
    res, err := loader.Load(conf)
    if err == nil {
      checks = append(checks, res...)
    }
  }
}
// `checks` contains one check per configuration instance found.

# Packages

Package defaults provides common defaults used in agent checks.

# Functions

BuildID returns an unique ID for a check name and its configuration.
CollectDefaultMetrics returns if the config is for a JMX check which has collect_default_metrics: true.
Identify returns an unique ID for a check and its configuration.
IDToCheckName returns the check name from a check ID.
IsJMXConfig checks if a certain YAML config contains at least one instance of a JMX config.
IsJMXInstance checks if a certain YAML instance is a JMX config.
NewSenderStats creates a new SenderStats.
NewStats returns a new check stats instance.
Retry retries a callback up to `retries`-times in a `retryDuration` period of time, and bails out if the limit is reached.
TranslateEventPlatformEventTypes translates the event platform event types in aggregator stats to human readable names.

# Variables

EventPlatformNameTranslations contains human readable translations for event platform event types.

# Structs

RetryableError is the error type that Retry interprets as a request to retry the callback.
SenderStats contains statistics showing the count of various types of telemetry sent by a check sender.
Stats holds basic runtime statistics about check instances.
StubCheck stubs a check, should only be used in tests.

# Interfaces

Check is an interface for types capable to run checks.
Loader is the interface wrapping the operations to load a check from different sources, like Python modules or Go objects.

# Type aliases

ID is the representation of the unique ID of a Check instance.