cadvisor: github.com/google/cadvisor/metrics Index | Files

package metrics

import "github.com/google/cadvisor/metrics"

Index

Package Files

metrics.go prometheus.go prometheus_fake.go prometheus_machine.go

Constants

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"
)

func BaseContainerLabels Uses

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 Uses

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.

type ContainerLabelsFunc Uses

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 Uses

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

PrometheusCollector implements prometheus.Collector.

func NewPrometheusCollector Uses

func NewPrometheusCollector(i infoProvider, f ContainerLabelsFunc, includedMetrics container.MetricSet, now clock.Clock, opts v2.RequestOptions) *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 Uses

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 Uses

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

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

type PrometheusMachineCollector Uses

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

PrometheusMachineCollector implements prometheus.Collector.

func NewPrometheusMachineCollector Uses

func NewPrometheusMachineCollector(i infoProvider, includedMetrics container.MetricSet) *PrometheusMachineCollector

NewPrometheusMachineCollector returns a new PrometheusCollector.

func (*PrometheusMachineCollector) Collect Uses

func (collector *PrometheusMachineCollector) Collect(ch chan<- prometheus.Metric)

Collect fetches information about machine and delivers them as Prometheus metrics. It implements prometheus.PrometheusCollector.

func (*PrometheusMachineCollector) Describe Uses

func (collector *PrometheusMachineCollector) Describe(ch chan<- *prometheus.Desc)

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

Package metrics imports 11 packages (graph) and is imported by 138 packages. Updated 2020-08-18. Refresh now. Tools for package owners.