Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerCheckFactory ¶
ContainerCheckFactory is exported for integration testing
Types ¶
type ContainerCheck ¶
ContainerCheck generates metrics for all containers
func (*ContainerCheck) Configure ¶
func (c *ContainerCheck) Configure(config, initConfig integration.Data, source string) error
Configure parses the check configuration and init the check
type ContainerConfig ¶
type ContainerConfig struct{}
ContainerConfig holds the check configuration
func (*ContainerConfig) Parse ¶
func (c *ContainerConfig) Parse(data []byte) error
Parse parses the container check config and set default values
type ContainerLister ¶
type ContainerLister interface {
List() ([]*workloadmeta.Container, error)
}
ContainerLister abstracts away how to list all known containers
type GenericMetricsAdapter ¶
type GenericMetricsAdapter struct{}
GenericMetricsAdapter implements MetricsAdapter API in a basic way. Adds `runtime` tag and do not change metrics.
func (GenericMetricsAdapter) AdaptMetrics ¶
func (a GenericMetricsAdapter) AdaptMetrics(metricName string, value float64) (string, float64)
AdaptMetrics is a passthrough (does not change anything)
func (GenericMetricsAdapter) AdaptTags ¶
func (a GenericMetricsAdapter) AdaptTags(tags []string, c *workloadmeta.Container) []string
AdaptTags adds a `runtime` tag for all containers
type MetadataContainerLister ¶
type MetadataContainerLister struct{}
MetadataContainerLister implements ContainerLister interface using Workload meta service
func (MetadataContainerLister) List ¶
func (l MetadataContainerLister) List() ([]*workloadmeta.Container, error)
List returns all known containers
type MetricsAdapter ¶
type MetricsAdapter interface { // AdaptTags can be used to change Tagger tags before submitting the metrics AdaptTags(tags []string, c *workloadmeta.Container) []string // AdaptMetrics can be used to change metrics (change name or value) before submitting the metric. AdaptMetrics(metricName string, value float64) (string, float64) }
MetricsAdapter provides a way to change metrics and tags before sending them out
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor contains the core logic of the generic check, allowing reusability
func NewProcessor ¶
func NewProcessor(provider metrics.Provider, lister ContainerLister, adapter MetricsAdapter, filter *containers.Filter) Processor
NewProcessor creates a new processor