Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ filesystem | Exposes filesystem statistics, such as disk space used. | Darwin, D
hwmon | Expose hardware monitoring and sensor data from `/sys/class/hwmon/`. | Linux
infiniband | Exposes network statistics specific to InfiniBand and Intel OmniPath configurations. | Linux
ipvs | Exposes IPVS status from `/proc/net/ip_vs` and stats from `/proc/net/ip_vs_stats`. | Linux
kernel_hung | Exposes number of tasks that have been detected as hung from `/proc/sys/kernel/hung_task_detect_count`. | Linux
loadavg | Exposes load average. | Darwin, Dragonfly, FreeBSD, Linux, NetBSD, OpenBSD, Solaris
mdadm | Exposes statistics about devices in `/proc/mdstat` (does nothing if no `/proc/mdstat` present). | Linux
meminfo | Exposes memory statistics. | Darwin, Dragonfly, FreeBSD, Linux, OpenBSD
Expand Down Expand Up @@ -195,7 +196,6 @@ drm | Expose GPU metrics using sysfs / DRM, `amdgpu` is the only driver which ex
drbd | Exposes Distributed Replicated Block Device statistics (to version 8.4) | Linux
ethtool | Exposes network interface information and network driver statistics equivalent to `ethtool`, `ethtool -S`, and `ethtool -i`. | Linux
interrupts | Exposes detailed interrupts statistics. | Linux, OpenBSD
kernel_hung | Exposes number of tasks that have been detected as hung from `/proc/sys/kernel/hung_task_detect_count`. | Linux
ksmd | Exposes kernel and system statistics from `/sys/kernel/mm/ksm`. | Linux
lnstat | Exposes stats from `/proc/net/stat/`. | Linux
logind | Exposes session counts from [logind](http://www.freedesktop.org/wiki/Software/systemd/logind/). | Linux
Expand Down
4 changes: 4 additions & 0 deletions collector/fixtures/e2e-64k-page-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,9 @@ node_ipvs_outgoing_bytes_total 0
# HELP node_ipvs_outgoing_packets_total The total number of outgoing packets.
# TYPE node_ipvs_outgoing_packets_total counter
node_ipvs_outgoing_packets_total 0
# HELP node_kernel_hung_tasks_total Total number of tasks that have been detected as hung since the system booted.
# TYPE node_kernel_hung_tasks_total counter
node_kernel_hung_tasks_total 42
# HELP node_ksmd_full_scans_total ksmd 'full_scans' file.
# TYPE node_ksmd_full_scans_total counter
node_ksmd_full_scans_total 323
Expand Down Expand Up @@ -3660,6 +3663,7 @@ node_scrape_collector_success{collector="hwmon"} 1
node_scrape_collector_success{collector="infiniband"} 1
node_scrape_collector_success{collector="interrupts"} 1
node_scrape_collector_success{collector="ipvs"} 1
node_scrape_collector_success{collector="kernel_hung"} 1
node_scrape_collector_success{collector="ksmd"} 1
node_scrape_collector_success{collector="lnstat"} 1
node_scrape_collector_success{collector="loadavg"} 1
Expand Down
4 changes: 4 additions & 0 deletions collector/fixtures/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,9 @@ node_ipvs_outgoing_bytes_total 0
# HELP node_ipvs_outgoing_packets_total The total number of outgoing packets.
# TYPE node_ipvs_outgoing_packets_total counter
node_ipvs_outgoing_packets_total 0
# HELP node_kernel_hung_tasks_total Total number of tasks that have been detected as hung since the system booted.
# TYPE node_kernel_hung_tasks_total counter
node_kernel_hung_tasks_total 42
# HELP node_ksmd_full_scans_total ksmd 'full_scans' file.
# TYPE node_ksmd_full_scans_total counter
node_ksmd_full_scans_total 323
Expand Down Expand Up @@ -3692,6 +3695,7 @@ node_scrape_collector_success{collector="hwmon"} 1
node_scrape_collector_success{collector="infiniband"} 1
node_scrape_collector_success{collector="interrupts"} 1
node_scrape_collector_success{collector="ipvs"} 1
node_scrape_collector_success{collector="kernel_hung"} 1
node_scrape_collector_success{collector="ksmd"} 1
node_scrape_collector_success{collector="lnstat"} 1
node_scrape_collector_success{collector="loadavg"} 1
Expand Down
1 change: 1 addition & 0 deletions collector/fixtures/proc/sys/kernel/hung_task_detect_count
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42
8 changes: 4 additions & 4 deletions collector/kernel_hung_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type kernelHungCollector struct {
}

func init() {
registerCollector("kernel_hung", defaultDisabled, NewKernelHungCollector)
registerCollector("kernel_hung", defaultEnabled, NewKernelHungCollector)
}

func NewKernelHungCollector(logger *slog.Logger) (Collector, error) {
Expand All @@ -44,8 +44,8 @@ func NewKernelHungCollector(logger *slog.Logger) (Collector, error) {
}

var (
taskDetectCount = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "kernel_hung", "task_detect_count"),
kernelHungTasks = prometheus.NewDesc(
prometheus.BuildFQName(namespace, "kernel_hung", "tasks_total"),
"Total number of tasks that have been detected as hung since the system booted.",
nil, nil,
)
Expand All @@ -57,7 +57,7 @@ func (c *kernelHungCollector) Update(ch chan<- prometheus.Metric) error {
return err
}

ch <- prometheus.MustNewConstMetric(taskDetectCount, prometheus.CounterValue, float64(*kernelHung.HungTaskDetectCount))
ch <- prometheus.MustNewConstMetric(kernelHungTasks, prometheus.CounterValue, float64(*kernelHung.HungTaskDetectCount))

return nil
}
1 change: 1 addition & 0 deletions end-to-end-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ enabled_collectors=$(cat << COLLECTORS
infiniband
interrupts
ipvs
kernel_hung
ksmd
lnstat
loadavg
Expand Down
Loading