nodehost

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package nodehost reads the node's CPU, memory, filesystems, and physical network interface counters for the node agent, with node_exporter series names.

Index

Constants

View Source
const DefaultMaxDevices = 64

DefaultMaxDevices bounds the network devices read per gather.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector gathers node_cpu_*, node_memory_*, node_filesystem_*, and node_network_* series.

func New

func New(o Options) *Collector

New returns a Collector with defaults applied.

func (*Collector) Gather

func (c *Collector) Gather(emit func(l labels.Labels, v float64)) (Stats, error)

Gather emits every series once; a memory read failure fails the gather, a network failure is reported in Stats.

type Options

type Options struct {
	// ProcPath holds meminfo; a container's /proc reports the node's memory.
	ProcPath string
	// SysPath is the node's sysfs; it must be the host mount, since a pod's own /sys lists only the pod's interfaces.
	SysPath string
	// Filesystems are host paths mounted into the agent; each distinct filesystem among them is reported once, labeled with the first path.
	Filesystems []string
	Node        string
	MaxDevices  int
}

Options configures a Collector.

type Stats

type Stats struct {
	Series int
	// Devices is the number of physical network devices read; zero when sysfs is unavailable.
	Devices int
	// NetworkError explains why network devices could not be read; empty when they were.
	NetworkError string
}

Stats describes one gather.

Jump to

Keyboard shortcuts

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