cadvisor

package
v0.0.0-...-ea6686e Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginName    = "cadvisor"
	PluginVendor  = "grafanalabs"
	PluginVersion = 1
)

Plugin specifc constants

View Source
const (
	KubernetesPodNameLabel       = "io.kubernetes.pod.name"
	KubernetesPodNamespaceLabel  = "io.kubernetes.pod.namespace"
	KubernetesContainerNameLabel = "io.kubernetes.container.name"
)

kubernetes label constants, !Importing from kubernetes adds overhead

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector contains the components to collect cadvisor metrics

func NewCollector

func NewCollector() *Collector

NewCollector returns a new active cadvisor collector

func (Collector) GetConfigPolicy

func (Collector) GetConfigPolicy() (plugin.ConfigPolicy, error)

GetConfigPolicy returns the configPolicy for your plugin. A config policy is how users can provide configuration info to plugin. Here you define what sorts of config info your plugin needs and/or requires.

func (Collector) GetMetricTypes

func (c Collector) GetMetricTypes(cfg plugin.Config) ([]plugin.Metric, error)

GetMetricTypes will be called when your plugin is loaded in order to populate the metric catalog(where snaps stores all available metrics). Config info is passed in. This config information would come from global config snap settings. The metrics returned will be advertised to users who list all the metrics and will become targetable by tasks.

func (*Collector) StreamMetrics

func (c *Collector) StreamMetrics(ctx context.Context, mtxIn chan []plugin.Metric, mtxOut chan []plugin.Metric, chanErr chan string) error

StreamMetrics takes both an in and out channel of []plugin.Metric

The mtxIn channel is used to set/update the metrics that Snap is currently requesting to be collected by the plugin.

The mtxOut channel is used by the plugin to send the collected metrics to Snap.

type DiskIoMetric

type DiskIoMetric struct {
	Namespace   func(ns string, pn string, cn string, name string) plugin.Namespace
	Description string
	Unit        string
	Tags        map[string]string
	Data        func(s v1.PerDiskStats) interface{}
}

DiskIoMetric type to translate v1.InterfaceStats into a snap Metric

type IfaceMetric

type IfaceMetric struct {
	Namespace   func(ns string, pn string, cn string, name string) plugin.Namespace
	Description string
	Unit        string
	Tags        map[string]string
	Data        func(s v1.InterfaceStats) interface{}
}

IfaceMetric type to translate v1.InterfaceStats into a snap Metric

type Manifest

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

Manifest maintains a list of metrics that must be gathered by the colllector

type Metric

type Metric struct {
	Namespace   func(ns string, pn string, cn string) plugin.Namespace
	Description string
	Unit        string
	Tags        map[string]string
	Data        func(s *info.ContainerStats) interface{}
}

Metric type to translate v2.ContainerInfo into a snap Metric

Jump to

Keyboard shortcuts

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