package v1
import "github.com/containerd/containerd/metrics/cgroups/v1"
Index ¶
- Variables
- func NewTaskMonitor(ctx context.Context, publisher events.Publisher, ns *metrics.Namespace) (runtime.TaskMonitor, error)
- type Collector
- func NewCollector(ns *metrics.Namespace) *Collector
- func (c *Collector) Add(t common.Statable, labels map[string]string) error
- func (c *Collector) Collect(ch chan<- prometheus.Metric)
- func (c *Collector) Describe(ch chan<- *prometheus.Desc)
- func (c *Collector) Remove(t common.Statable)
- func (c *Collector) RemoveAll()
- type Trigger
Variables ¶
var IDName = "container_id"
IDName is the name that is used to identify the id being collected in the metric
Functions ¶
func NewTaskMonitor ¶
func NewTaskMonitor(ctx context.Context, publisher events.Publisher, ns *metrics.Namespace) (runtime.TaskMonitor, error)
NewTaskMonitor returns a new cgroups monitor
Types ¶
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 ¶
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 ¶
Remove removes the provided cgroup by id from the collector
func (*Collector) RemoveAll ¶
func (c *Collector) RemoveAll()
RemoveAll statable items from the collector
type Trigger ¶
Trigger will be called when an event happens and provides the cgroup where the event originated from
Source Files ¶
blkio.go cgroups.go cpu.go hugetlb.go memory.go metric.go metrics.go oom.go pids.go
- Version
- v1.7.24
- Published
- Nov 21, 2024
- Platform
- linux/amd64
- Imports
- 22 packages
- Last checked
- 4 seconds ago –
Tools for package owners.