Skip to content

[probes.system] Add a system probe that exports machine metrics - #1183

Merged
manugarg merged 8 commits into
mainfrom
system_probe
Dec 9, 2025
Merged

manugarg merged 8 commits into
mainfrom
system_probe

Conversation

@manugarg

@manugarg manugarg commented Dec 7, 2025 •

Copy link
Copy Markdown
Contributor

This PR introduces a new native SYSTEM probe type to Cloudprober. This probe collects system-level metrics (CPU, Memory, Disk, Network, etc.) directly from the underlying OS (Linux /proc filesystem and syscalls) without requiring external agents or dependencies like gopsutil.

The system probe is enabled by default to provide immediate value out-of-the-box, but can be disabled via a command-line flag (--disable_sys_metrics) or configured explicitly.

Changes

New Probe: probes/system

  • Implemented Probe struct and interface.
  • Metric Collection:
    • Resource Usage: File descriptors, uptime, load average (1m/5m/15m).
    • Process Stats: Running, blocked, and total processes.
    • Socket Stats: TCP/UDP sockets in use/alloc/orphan.
    • Network I/O: RX/TX bytes, packets, errors, and drops per interface (from /proc/net/dev).
  • Metric Types: Correctly distinguishes between GAUGE (snapshot values like memory/load) and CUMULATIVE (monotonic counters like network/disk I/O).

To be added:
- Memory: Total, free, available, buffers, and cached memory (from /proc/meminfo).
- Disk Usage: Total, free, used bytes and percentage for root volume (via syscall.Statfs).
- Disk I/O: Read/write bytes and counts per device (from /proc/diskstats).

Example Configuration

The probe runs automatically, but can be customized:

probe {
  name: "sys_metrics"
  type: SYSTEM
  interval: "1m"
  system_probe {
    disable_net_dev_stats: true
  }
}

@manugarg manugarg changed the title [probes.system] Add a system probe that exports host health metrics [probes.system] Add a system probe that exports machine health metrics Dec 9, 2025
@manugarg manugarg changed the title [probes.system] Add a system probe that exports machine health metrics [probes.system] Add a system probe that exports machine metrics Dec 9, 2025
@manugarg
manugarg merged commit 3ba5bb0 into main Dec 9, 2025
@manugarg
manugarg deleted the system_probe branch December 9, 2025 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant