Documentation
¶
Overview ¶
Package collector reads Netdata-compatible OS metrics from procfs and sysfs and feeds them into the shared metrics registry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface {
Name() string
Init(reg metrics.Registry, prefix string)
Collect() error
}
Collector reads OS metrics from procfs/sysfs and updates Prometheus gauges. Init is called once at startup to create metric handles. Collect is called on every tick to read current values and update those handles.
type CollectorOverride ¶
CollectorOverride holds per-collector config from YANG. Zero Interval means inherit the global interval.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager runs all registered collectors on a configurable tick interval, feeding Netdata-compatible Prometheus metrics into the shared registry.
func NewManager ¶
func NewManager(reg metrics.Registry, prefix string, interval time.Duration, logger *slog.Logger) *Manager
NewManager creates a Manager that will register metrics on reg with the given name prefix (default "netdata") and collect at the given interval.
func StartOSCollectors ¶
func StartOSCollectors(reg metrics.Registry, prefix string, interval time.Duration, overrides map[string]CollectorOverride, logger *slog.Logger) *Manager
StartOSCollectors creates a Manager with all platform-specific OS collectors and starts collection. Per-collector overrides control enable/disable and interval. Returns the Manager so callers can call Stop() on shutdown; returns nil if no collectors are available.
Source Files
¶
- btrfs_linux.go
- collector.go
- conntrack_expect_linux.go
- conntrack_linux.go
- cpu_linux.go
- cpufreq_linux.go
- cpuidle_linux.go
- delta_linux.go
- diskspace_linux.go
- diskstats_linux.go
- doc.go
- entropy_linux.go
- filenr_linux.go
- ipvs_linux.go
- loadavg_linux.go
- mdstat_linux.go
- memory_linux.go
- netdev_linux.go
- netiface_linux.go
- netstat_linux.go
- platform_linux.go
- pressure_linux.go
- sctp_linux.go
- snmp6_linux.go
- snmp_linux.go
- sockstat6_linux.go
- sockstat_linux.go
- softirqs_linux.go
- softnet_linux.go
- softnet_percpu_linux.go
- stat_linux.go
- uptime_linux.go
- vmstat_linux.go
- wireless_linux.go
- zfs_linux.go