Documentation ¶
Index ¶
Constants ¶
const ( PluginName = "cadvisor" PluginVendor = "grafanalabs" PluginVersion = 1 )
Plugin specifc constants
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 ¶
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