metrics

package
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContainerLabelPrefix is the prefix added to all container labels.
	ContainerLabelPrefix = "container_label_"
	// ContainerEnvPrefix is the prefix added to all env variable labels.
	ContainerEnvPrefix = "container_env_"
	// LabelID is the name of the id label.
	LabelID = "id"
	// LabelName is the name of the name label.
	LabelName = "name"
	// LabelImage is the name of the image label.
	LabelImage = "image"
)

Variables

This section is empty.

Functions

func BaseContainerLabels added in v0.31.0

func BaseContainerLabels(whiteList []string) func(container *info.ContainerInfo) map[string]string

BaseContainerLabels returns a ContainerLabelsFunc that exports the container name, first alias, image name as well as white listed label values.

func DefaultContainerLabels added in v0.24.0

func DefaultContainerLabels(container *info.ContainerInfo) map[string]string

DefaultContainerLabels implements ContainerLabelsFunc. It exports the container name, first alias, image name as well as all its env and label values.

Types

type ContainerLabelsFunc added in v0.24.0

type ContainerLabelsFunc func(*info.ContainerInfo) map[string]string

ContainerLabelsFunc defines all base labels and their values attached to each metric exported by cAdvisor.

type PrometheusCollector

type PrometheusCollector struct {
	// contains filtered or unexported fields
}

PrometheusCollector implements prometheus.Collector.

func NewPrometheusCollector

func NewPrometheusCollector(i infoProvider, f ContainerLabelsFunc, includedMetrics container.MetricSet) *PrometheusCollector

NewPrometheusCollector returns a new PrometheusCollector. The passed ContainerLabelsFunc specifies which base labels will be attached to all exported metrics. If left to nil, the DefaultContainerLabels function will be used instead.

func (*PrometheusCollector) Collect

func (c *PrometheusCollector) Collect(ch chan<- prometheus.Metric)

Collect fetches the stats from all containers and delivers them as Prometheus metrics. It implements prometheus.PrometheusCollector.

func (*PrometheusCollector) Describe

func (c *PrometheusCollector) Describe(ch chan<- *prometheus.Desc)

Describe describes all the metrics ever exported by cadvisor. It implements prometheus.PrometheusCollector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL