Version: v1.4.2 Latest Latest

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

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 13 Imported by: 0




This section is empty.


View Source
var IDName = "container_id"

IDName is the name that is used to identify the id being collected in the metric


func NewTaskMonitor

func NewTaskMonitor(ctx context.Context, publisher events.Publisher, ns *metrics.Namespace) (runtime.TaskMonitor, error)

NewTaskMonitor returns a new cgroups monitor


type Collector

type Collector struct {
	// contains filtered or unexported fields

Collector provides the ability to collect container stats and export them in the prometheus format

func NewCollector

func NewCollector(ns *metrics.Namespace) *Collector

NewCollector registers the collector with the provided namespace and returns it so that cgroups can be added for collection

func (*Collector) Add

func (c *Collector) Add(t Statable) error

Add adds the provided cgroup and id so that metrics are collected and exported

func (*Collector) Collect

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

Collect prometheus metrics

func (*Collector) Describe

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

Describe prometheus metrics

func (*Collector) Remove

func (c *Collector) Remove(t Statable)

Remove removes the provided cgroup by id from the collector

func (*Collector) RemoveAll

func (c *Collector) RemoveAll()

RemoveAll statable items from the collector

type Statable

type Statable interface {
	ID() string
	Namespace() string
	Stats(context.Context) (*types.Any, error)

Statable type that returns cgroup metrics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL