Skip to content

in_node_exporter_metrics: implement additional metrics (filesystem, EXT_* metrics, powersupplyclass) on node exporter metrics#11765

Open
cosmo0920 wants to merge 6 commits intomasterfrom
cosmo0920-implement-additional-metrics-on-node_exporter_metrics
Open

in_node_exporter_metrics: implement additional metrics (filesystem, EXT_* metrics, powersupplyclass) on node exporter metrics#11765
cosmo0920 wants to merge 6 commits intomasterfrom
cosmo0920-implement-additional-metrics-on-node_exporter_metrics

Conversation

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 commented May 1, 2026

I added filesystem metrics on macOS, powersupplyclass for Linux/macOS, and EXT extensions for netstat of Linux.

Closes #11763.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change

For macOS, I tested with:

$ bin/fluent-bit -i node_exporter_metrics -p metrics=filesystem,powersupplyclass -pscrape_interval=1 -o stdout -v 

For Linux, I tested with:

$ bin/fluent-bit -i node_exporter_metrics -pmetrics=powersupplyclass,netstat -o stdout -v
  • Debug log output from testing the change

For macOS:

Fluent Bit v5.0.4
* Copyright (C) 2015-2026 The Fluent Bit Authors
* Fluent Bit is a CNCF graduated project under the Fluent organization
* https://fluentbit.io

______ _                  _    ______ _ _           _____  _____ 
|  ___| |                | |   | ___ (_) |         |  ___||  _  |
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   _|___ \ | |/' |
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / /   \ \|  /| |
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V //\__/ /\ |_/ /
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/ \____(_)\___/


[2026/05/01 18:12:58.271] [ info] Configuration:
[2026/05/01 18:12:58.271] [ info]  flush time     | 1.000000 seconds
[2026/05/01 18:12:58.271] [ info]  grace          | 5 seconds
[2026/05/01 18:12:58.271] [ info]  daemon         | 0
[2026/05/01 18:12:58.271] [ info] ___________
[2026/05/01 18:12:58.271] [ info]  inputs:
[2026/05/01 18:12:58.271] [ info]      node_exporter_metrics
[2026/05/01 18:12:58.271] [ info] ___________
[2026/05/01 18:12:58.271] [ info]  filters:
[2026/05/01 18:12:58.271] [ info] ___________
[2026/05/01 18:12:58.271] [ info]  outputs:
[2026/05/01 18:12:58.271] [ info]      stdout.0
[2026/05/01 18:12:58.271] [ info] ___________
[2026/05/01 18:12:58.271] [ info]  collectors:
[2026/05/01 18:12:58.271] [ info] [fluent bit] version=5.0.4, commit=70caab4bb2, pid=95767
[2026/05/01 18:12:58.271] [debug] [engine] coroutine stack size: 36864 bytes (36.0K)
[2026/05/01 18:12:58.271] [ info] [storage] ver=1.4.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2026/05/01 18:12:58.271] [ info] [simd    ] NEON
[2026/05/01 18:12:58.271] [ info] [cmetrics] version=2.1.2
[2026/05/01 18:12:58.271] [ info] [ctraces ] version=0.7.1
[2026/05/01 18:12:58.271] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] initializing
[2026/05/01 18:12:58.271] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] storage_strategy='memory' (memory only)
[2026/05/01 18:12:58.271] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.rootfs = /
[2026/05/01 18:12:58.271] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.procfs = /proc
[2026/05/01 18:12:58.271] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.sysfs  = /sys
[2026/05/01 18:12:58.271] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics filesystem
[2026/05/01 18:12:58.272] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics powersupplyclass
[2026/05/01 18:12:58.272] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] [thread init] initialization OK
[2026/05/01 18:12:58.272] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] thread instance initialized
[2026/05/01 18:12:58.272] [debug] [node_exporter_metrics:node_exporter_metrics.0] created event channels: read=33 write=34
[2026/05/01 18:12:58.272] [debug] [stdout:stdout.0] created event channels: read=37 write=38
[2026/05/01 18:12:58.272] [ info] [output:stdout:stdout.0] worker #0 started
[2026/05/01 18:12:58.272] [ info] [sp] stream processor started
[2026/05/01 18:12:58.272] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2
[2026/05/01 18:13:00.276] [debug] [task] created task=0xb91031b00 id=0 OK
[2026/05/01 18:13:00.276] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
2026-05-01T09:12:59.276278433Z node_filesystem_avail_bytes{device="/dev/disk3s1s1",fstype="apfs",mountpoint="/"} = 1365824851968
2026-05-01T09:12:59.276278433Z node_filesystem_avail_bytes{device="/dev/disk3s6",fstype="apfs",mountpoint="/System/Volumes/VM"} = 1365878747136
2026-05-01T09:12:59.276278433Z node_filesystem_avail_bytes{device="/dev/disk3s2",fstype="apfs",mountpoint="/System/Volumes/Preboot"} = 1365846110208
2026-05-01T09:12:59.276278433Z node_filesystem_avail_bytes{device="/dev/disk3s4",fstype="apfs",mountpoint="/System/Volumes/Update"} = 1365878755328
2026-05-01T09:12:59.276278433Z node_filesystem_avail_bytes{device="/dev/disk2s2",fstype="apfs",mountpoint="/System/Volumes/xarts"} = 556847104
2026-05-01T09:12:59.276278433Z node_filesystem_avail_bytes{device="/dev/disk2s1",fstype="apfs",mountpoint="/System/Volumes/iSCPreboot"} = 556847104
2026-05-01T09:12:59.276278433Z node_filesystem_avail_bytes{device="/dev/disk2s3",fstype="apfs",mountpoint="/System/Volumes/Hardware"} = 556847104
2026-05-01T09:12:59.276278433Z node_filesystem_avail_bytes{device="/dev/disk3s5",fstype="apfs",mountpoint="/System/Volumes/Data"} = 1365823926272
2026-05-01T09:12:59.276278433Z node_filesystem_device_error{device="/dev/disk3s1s1",fstype="apfs",mountpoint="/"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_device_error{device="/dev/disk3s6",fstype="apfs",mountpoint="/System/Volumes/VM"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_device_error{device="/dev/disk3s2",fstype="apfs",mountpoint="/System/Volumes/Preboot"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_device_error{device="/dev/disk3s4",fstype="apfs",mountpoint="/System/Volumes/Update"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_device_error{device="/dev/disk2s2",fstype="apfs",mountpoint="/System/Volumes/xarts"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_device_error{device="/dev/disk2s1",fstype="apfs",mountpoint="/System/Volumes/iSCPreboot"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_device_error{device="/dev/disk2s3",fstype="apfs",mountpoint="/System/Volumes/Hardware"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_device_error{device="/dev/disk3s5",fstype="apfs",mountpoint="/System/Volumes/Data"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_files{device="/dev/disk3s1s1",fstype="apfs",mountpoint="/"} = 4294503755
2026-05-01T09:12:59.276278433Z node_filesystem_files{device="/dev/disk3s6",fstype="apfs",mountpoint="/System/Volumes/VM"} = 13338659640
2026-05-01T09:12:59.276278433Z node_filesystem_files{device="/dev/disk3s2",fstype="apfs",mountpoint="/System/Volumes/Preboot"} = 13338342454
2026-05-01T09:12:59.276278433Z node_filesystem_files{device="/dev/disk3s4",fstype="apfs",mountpoint="/System/Volumes/Update"} = 13338659782
2026-05-01T09:12:59.276278433Z node_filesystem_files{device="/dev/disk2s2",fstype="apfs",mountpoint="/System/Volumes/xarts"} = 5437961
2026-05-01T09:12:59.276278433Z node_filesystem_files{device="/dev/disk2s1",fstype="apfs",mountpoint="/System/Volumes/iSCPreboot"} = 5437999
2026-05-01T09:12:59.276278433Z node_filesystem_files{device="/dev/disk2s3",fstype="apfs",mountpoint="/System/Volumes/Hardware"} = 5438066
2026-05-01T09:12:59.276278433Z node_filesystem_files{device="/dev/disk3s5",fstype="apfs",mountpoint="/System/Volumes/Data"} = 13342572770
2026-05-01T09:12:59.276278433Z node_filesystem_files_free{device="/dev/disk3s1s1",fstype="apfs",mountpoint="/"} = 4294045639
2026-05-01T09:12:59.276278433Z node_filesystem_files_free{device="/dev/disk3s6",fstype="apfs",mountpoint="/System/Volumes/VM"} = 13338659640
2026-05-01T09:12:59.276278433Z node_filesystem_files_free{device="/dev/disk3s2",fstype="apfs",mountpoint="/System/Volumes/Preboot"} = 13338340920
2026-05-01T09:12:59.276278433Z node_filesystem_files_free{device="/dev/disk3s4",fstype="apfs",mountpoint="/System/Volumes/Update"} = 13338659720
2026-05-01T09:12:59.276278433Z node_filesystem_files_free{device="/dev/disk2s2",fstype="apfs",mountpoint="/System/Volumes/xarts"} = 5437960
2026-05-01T09:12:59.276278433Z node_filesystem_files_free{device="/dev/disk2s1",fstype="apfs",mountpoint="/System/Volumes/iSCPreboot"} = 5437960
2026-05-01T09:12:59.276278433Z node_filesystem_files_free{device="/dev/disk2s3",fstype="apfs",mountpoint="/System/Volumes/Hardware"} = 5437960
2026-05-01T09:12:59.276278433Z node_filesystem_files_free{device="/dev/disk3s5",fstype="apfs",mountpoint="/System/Volumes/Data"} = 13338124280
2026-05-01T09:12:59.276278433Z node_filesystem_free_bytes{device="/dev/disk3s1s1",fstype="apfs",mountpoint="/"} = 1365824851968
2026-05-01T09:12:59.276278433Z node_filesystem_free_bytes{device="/dev/disk3s6",fstype="apfs",mountpoint="/System/Volumes/VM"} = 1365878747136
2026-05-01T09:12:59.276278433Z node_filesystem_free_bytes{device="/dev/disk3s2",fstype="apfs",mountpoint="/System/Volumes/Preboot"} = 1365846110208
2026-05-01T09:12:59.276278433Z node_filesystem_free_bytes{device="/dev/disk3s4",fstype="apfs",mountpoint="/System/Volumes/Update"} = 1365878755328
2026-05-01T09:12:59.276278433Z node_filesystem_free_bytes{device="/dev/disk2s2",fstype="apfs",mountpoint="/System/Volumes/xarts"} = 556847104
2026-05-01T09:12:59.276278433Z node_filesystem_free_bytes{device="/dev/disk2s1",fstype="apfs",mountpoint="/System/Volumes/iSCPreboot"} = 556847104
2026-05-01T09:12:59.276278433Z node_filesystem_free_bytes{device="/dev/disk2s3",fstype="apfs",mountpoint="/System/Volumes/Hardware"} = 556847104
2026-05-01T09:12:59.276278433Z node_filesystem_free_bytes{device="/dev/disk3s5",fstype="apfs",mountpoint="/System/Volumes/Data"} = 1365823926272
2026-05-01T09:12:59.276278433Z node_filesystem_readonly{device="/dev/disk3s1s1",fstype="apfs",mountpoint="/"} = 1
2026-05-01T09:12:59.276278433Z node_filesystem_readonly{device="/dev/disk3s6",fstype="apfs",mountpoint="/System/Volumes/VM"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_readonly{device="/dev/disk3s2",fstype="apfs",mountpoint="/System/Volumes/Preboot"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_readonly{device="/dev/disk3s4",fstype="apfs",mountpoint="/System/Volumes/Update"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_readonly{device="/dev/disk2s2",fstype="apfs",mountpoint="/System/Volumes/xarts"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_readonly{device="/dev/disk2s1",fstype="apfs",mountpoint="/System/Volumes/iSCPreboot"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_readonly{device="/dev/disk2s3",fstype="apfs",mountpoint="/System/Volumes/Hardware"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_readonly{device="/dev/disk3s5",fstype="apfs",mountpoint="/System/Volumes/Data"} = 0
2026-05-01T09:12:59.276278433Z node_filesystem_size_bytes{device="/dev/disk3s1s1",fstype="apfs",mountpoint="/"} = 1995165736960
2026-05-01T09:12:59.276278433Z node_filesystem_size_bytes{device="/dev/disk3s6",fstype="apfs",mountpoint="/System/Volumes/VM"} = 1995165736960
2026-05-01T09:12:59.276278433Z node_filesystem_size_bytes{device="/dev/disk3s2",fstype="apfs",mountpoint="/System/Volumes/Preboot"} = 1995165736960
2026-05-01T09:12:59.276278433Z node_filesystem_size_bytes{device="/dev/disk3s4",fstype="apfs",mountpoint="/System/Volumes/Update"} = 1995165736960
2026-05-01T09:12:59.276278433Z node_filesystem_size_bytes{device="/dev/disk2s2",fstype="apfs",mountpoint="/System/Volumes/xarts"} = 576716800
2026-05-01T09:12:59.276278433Z node_filesystem_size_bytes{device="/dev/disk2s1",fstype="apfs",mountpoint="/System/Volumes/iSCPreboot"} = 576716800
2026-05-01T09:12:59.276278433Z node_filesystem_size_bytes{device="/dev/disk2s3",fstype="apfs",mountpoint="/System/Volumes/Hardware"} = 576716800
2026-05-01T09:12:59.276278433Z node_filesystem_size_bytes{device="/dev/disk3s5",fstype="apfs",mountpoint="/System/Volumes/Data"} = 1995165736960
2026-05-01T09:12:59.276352100Z node_powersupply_current_capacity{power_supply="InternalBattery-0"} = 80
2026-05-01T09:12:59.276352100Z node_powersupply_max_capacity{power_supply="InternalBattery-0"} = 100
2026-05-01T09:12:59.276352100Z node_powersupply_time_to_empty_seconds{power_supply="InternalBattery-0"} = 0
2026-05-01T09:12:59.276352100Z node_powersupply_time_to_full_seconds{power_supply="InternalBattery-0"} = 0
2026-05-01T09:12:59.276352100Z node_powersupply_current_ampere{power_supply="InternalBattery-0"} = 0
2026-05-01T09:12:59.276352100Z node_powersupply_present{power_supply="InternalBattery-0"} = 1
2026-05-01T09:12:59.276352100Z node_powersupply_charging{power_supply="InternalBattery-0"} = 0
2026-05-01T09:12:59.276352100Z node_powersupply_charged{power_supply="InternalBattery-0"} = 0
2026-05-01T09:12:59.276352100Z node_powersupply_battery_health{power_supply="InternalBattery-0",state="Good"} = 1
2026-05-01T09:12:59.276352100Z node_powersupply_battery_health{power_supply="InternalBattery-0",state="Fair"} = 0
2026-05-01T09:12:59.276352100Z node_powersupply_battery_health{power_supply="InternalBattery-0",state="Poor"} = 0
[2026/05/01 18:13:00.278] [debug] [output:stdout:stdout.0] cmt decode msgpack returned : 1
[2026/05/01 18:13:00.278] [debug] [out flush] cb_destroy coro_id=0
[2026/05/01 18:13:00.279] [debug] [task] destroy task=0xb91031b00 (task_id=0)
^C[2026/05/01 18:13:00] [engine] caught signal (SIGINT)
[2026/05/01 18:13:00.824] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread pause instance
[2026/05/01 18:13:00.824] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2026/05/01 18:13:00.824] [ info] [output:stdout:stdout.0] thread worker #0 stopped
[2026/05/01 18:13:00.824] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread exit instance

For Linux,

Fluent Bit v5.0.4
* Copyright (C) 2015-2026 The Fluent Bit Authors
* Fluent Bit is a CNCF graduated project under the Fluent organization
* https://fluentbit.io

______ _                  _    ______ _ _           _____  _____ 
|  ___| |                | |   | ___ (_) |         |  ___||  _  |
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   _|___ \ | |/' |
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / /   \ \|  /| |
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V //\__/ /\ |_/ /
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/ \____(_)\___/


[2026/05/01 19:01:03.388] [ info] Configuration:
[2026/05/01 19:01:03.414] [ info]  flush time     | 1.000000 seconds
[2026/05/01 19:01:03.419] [ info]  grace          | 5 seconds
[2026/05/01 19:01:03.420] [ info]  daemon         | 0
[2026/05/01 19:01:03.420] [ info] ___________
[2026/05/01 19:01:03.420] [ info]  inputs:
[2026/05/01 19:01:03.421] [ info]      node_exporter_metrics
[2026/05/01 19:01:03.421] [ info] ___________
[2026/05/01 19:01:03.422] [ info]  filters:
[2026/05/01 19:01:03.422] [ info] ___________
[2026/05/01 19:01:03.422] [ info]  outputs:
[2026/05/01 19:01:03.423] [ info]      stdout.0
[2026/05/01 19:01:03.424] [ info] ___________
[2026/05/01 19:01:03.424] [ info]  collectors:
[2026/05/01 19:01:03.515] [ info] [fluent bit] version=5.0.4, commit=5806ad342d, pid=786817
[2026/05/01 19:01:03.526] [debug] [engine] coroutine stack size: 4194304 bytes (4.0M)
[2026/05/01 19:01:03.540] [ info] [storage] ver=1.5.4, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2026/05/01 19:01:03.540] [ info] [simd    ] SSE2
[2026/05/01 19:01:03.540] [ info] [cmetrics] version=2.1.2
[2026/05/01 19:01:03.541] [ info] [ctraces ] version=0.7.1
[2026/05/01 19:01:03.594] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] initializing
[2026/05/01 19:01:03.596] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] storage_strategy='memory' (memory only)
[2026/05/01 19:01:03.660] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.rootfs = /
[2026/05/01 19:01:03.661] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.procfs = /proc
[2026/05/01 19:01:03.663] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] path.sysfs  = /sys
[2026/05/01 19:01:03.703] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics powersupplyclass
[2026/05/01 19:01:03.772] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] enabled metrics netstat
[2026/05/01 19:01:03.780] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] [thread init] initialization OK
[2026/05/01 19:01:03.783] [ info] [input:node_exporter_metrics:node_exporter_metrics.0] thread instance initialized
[2026/05/01 19:01:03.786] [debug] [node_exporter_metrics:node_exporter_metrics.0] created event channels: read=32 write=33
[2026/05/01 19:01:03.800] [debug] [stdout:stdout.0] created event channels: read=36 write=37
[2026/05/01 19:01:03.872] [ info] [sp] stream processor started
[2026/05/01 19:01:03.877] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2
[2026/05/01 19:01:03.905] [ info] [output:stdout:stdout.0] worker #0 started
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_ActiveOpens = 8327
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_PassiveOpens = 1221
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_RetransSegs = 1861
2026-05-01T10:01:08.865192571Z node_netstat_Udp_InDatagrams = 402759
2026-05-01T10:01:08.865192571Z node_netstat_Udp_InErrors = 6
2026-05-01T10:01:08.865192571Z node_netstat_Udp_OutDatagrams = 275787
2026-05-01T10:01:08.865192571Z node_netstat_Udp_NoPorts = 401
2026-05-01T10:01:08.862260928Z node_powersupply_info{power_supply="BAT1"} = 1
2026-05-01T10:01:08.863753912Z node_powersupply_info{power_supply="ACAD"} = 1
2026-05-01T10:01:08.862260928Z node_powersupply_capacity{power_supply="BAT1"} = 100
2026-05-01T10:01:08.862260928Z node_powersupply_cyclecount{power_supply="BAT1"} = 0
2026-05-01T10:01:08.862260928Z node_powersupply_present{power_supply="BAT1"} = 1
2026-05-01T10:01:08.862260928Z node_powersupply_energy_full{power_supply="BAT1"} = 60.75
2026-05-01T10:01:08.862260928Z node_powersupply_energy_full_design{power_supply="BAT1"} = 66.519999999999996
2026-05-01T10:01:08.862260928Z node_powersupply_energy_watthour{power_supply="BAT1"} = 60.75
2026-05-01T10:01:08.862260928Z node_powersupply_voltage_min_design{power_supply="BAT1"} = 7.7000000000000002
2026-05-01T10:01:08.862260928Z node_powersupply_voltage_volt{power_supply="BAT1"} = 8.4830000000000005
2026-05-01T10:01:08.863753912Z node_powersupply_online{power_supply="ACAD"} = 1
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_CurrEstab = 18
2026-05-01T10:01:08.865192571Z node_netstat_Ip_Forwarding = 1
2026-05-01T10:01:08.865192571Z node_netstat_Ip_DefaultTTL = 64
2026-05-01T10:01:08.865192571Z node_netstat_Ip_InReceives = 1419121
2026-05-01T10:01:08.865192571Z node_netstat_Ip_InHdrErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_InAddrErrors = 1
2026-05-01T10:01:08.865192571Z node_netstat_Ip_ForwDatagrams = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_InUnknownProtos = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_InDiscards = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_InDelivers = 1419096
2026-05-01T10:01:08.865192571Z node_netstat_Ip_OutRequests = 953938
2026-05-01T10:01:08.865192571Z node_netstat_Ip_OutDiscards = 213
2026-05-01T10:01:08.865192571Z node_netstat_Ip_OutNoRoutes = 1688
2026-05-01T10:01:08.865192571Z node_netstat_Ip_ReasmTimeout = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_ReasmReqds = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_ReasmOKs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_ReasmFails = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_FragOKs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_FragFails = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_FragCreates = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip_OutTransmits = 953938
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InMsgs = 145
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InCsumErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InDestUnreachs = 145
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InTimeExcds = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InParmProbs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InSrcQuenchs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InRedirects = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InEchos = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InEchoReps = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InTimestamps = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InTimestampReps = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InAddrMasks = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_InAddrMaskReps = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutMsgs = 321
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutRateLimitGlobal = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutRateLimitHost = 80
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutDestUnreachs = 321
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutTimeExcds = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutParmProbs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutSrcQuenchs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutRedirects = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutEchos = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutEchoReps = 0
[2026/05/01 19:01:09.857] [debug] [task] created task=0x64a5ed0 id=0 OK
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutTimestamps = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutTimestampReps = 0
[2026/05/01 19:01:09.863] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutAddrMasks = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp_OutAddrMaskReps = 0
2026-05-01T10:01:08.865192571Z node_netstat_IcmpMsg_InType3 = 145
2026-05-01T10:01:08.865192571Z node_netstat_IcmpMsg_OutType3 = 321
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_RtoAlgorithm = 1
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_RtoMin = 200
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_RtoMax = 120000
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_MaxConn = -1
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_AttemptFails = 567
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_EstabResets = 213
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_InSegs = 1015749
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_OutSegs = 701435
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_InErrs = 14
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_OutRsts = 10285
2026-05-01T10:01:08.865192571Z node_netstat_Tcp_InCsumErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp_RcvbufErrors = 6
2026-05-01T10:01:08.865192571Z node_netstat_Udp_SndbufErrors = 193
2026-05-01T10:01:08.865192571Z node_netstat_Udp_InCsumErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp_IgnoredMulti = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp_MemErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_InDatagrams = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_NoPorts = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_InErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_OutDatagrams = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_RcvbufErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_SndbufErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_InCsumErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_IgnoredMulti = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite_MemErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InNoRoutes = 22
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InTruncatedPkts = 0
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InMcastPkts = 1052
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_OutMcastPkts = 1111
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InBcastPkts = 0
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_OutBcastPkts = 0
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InOctets = 4142697219
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_OutOctets = 246657028
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InMcastOctets = 116291
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_OutMcastOctets = 118731
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InBcastOctets = 0
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_OutBcastOctets = 0
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InCsumErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InNoECTPkts = 3297345
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InECT1Pkts = 0
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InECT0Pkts = 984
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_InCEPkts = 43
2026-05-01T10:01:08.865192571Z node_netstat_IpExt_ReasmOverlaps = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InReceives = 253
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InHdrErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InTooBigErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InNoRoutes = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InAddrErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InUnknownProtos = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InTruncatedPkts = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InDiscards = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InDelivers = 253
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutForwDatagrams = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutRequests = 517
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutDiscards = 30
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutNoRoutes = 22329
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_ReasmTimeout = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_ReasmReqds = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_ReasmOKs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_ReasmFails = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_FragOKs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_FragFails = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_FragCreates = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InMcastPkts = 223
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutMcastPkts = 489
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InOctets = 34842
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutOctets = 53010
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InMcastOctets = 32646
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutMcastOctets = 50966
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InBcastOctets = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutBcastOctets = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InNoECTPkts = 253
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InECT1Pkts = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InECT0Pkts = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_InCEPkts = 0
2026-05-01T10:01:08.865192571Z node_netstat_Ip6_OutTransmits = 517
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InMsgs = 2
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutMsgs = 236
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InCsumErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutRateLimitHost = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InDestUnreachs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InPktTooBigs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InTimeExcds = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InParmProblems = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InEchos = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InEchoReplies = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InGroupMembQueries = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InGroupMembResponses = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InGroupMembReductions = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InRouterSolicits = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InRouterAdvertisements = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InNeighborSolicits = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InNeighborAdvertisements = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InRedirects = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InMLDv2Reports = 2
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutDestUnreachs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutPktTooBigs = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutTimeExcds = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutParmProblems = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutEchos = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutEchoReplies = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutGroupMembQueries = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutGroupMembResponses = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutGroupMembReductions = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutRouterSolicits = 154
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutRouterAdvertisements = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutNeighborSolicits = 16
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutNeighborAdvertisements = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutRedirects = 0
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutMLDv2Reports = 66
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_InType143 = 2
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutType133 = 154
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutType135 = 16
2026-05-01T10:01:08.865192571Z node_netstat_Icmp6_OutType143 = 66
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_InDatagrams = 223
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_NoPorts = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_InErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_OutDatagrams = 223
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_RcvbufErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_SndbufErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_InCsumErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_IgnoredMulti = 0
2026-05-01T10:01:08.865192571Z node_netstat_Udp6_MemErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite6_InDatagrams = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite6_NoPorts = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite6_InErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite6_OutDatagrams = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite6_RcvbufErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite6_SndbufErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite6_InCsumErrors = 0
2026-05-01T10:01:08.865192571Z node_netstat_UdpLite6_MemErrors = 0
[2026/05/01 19:01:09.955] [debug] [output:stdout:stdout.0] cmt decode msgpack returned : 1
[2026/05/01 19:01:09.967] [debug] [out flush] cb_destroy coro_id=0
[2026/05/01 19:01:09.987] [debug] [task] destroy task=0x64a5ed0 (task_id=0)
^C[2026/05/01 19:01:10] [engine] caught signal (SIGINT)
[2026/05/01 19:01:10.368] [ warn] [engine] service will shutdown in max 5 seconds
[2026/05/01 19:01:10.370] [ info] [engine] pausing all inputs..
[2026/05/01 19:01:10.373] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread pause instance
[2026/05/01 19:01:10.842] [ info] [engine] service has stopped (0 pending tasks)
[2026/05/01 19:01:10.843] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread pause instance
[2026/05/01 19:01:10.852] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2026/05/01 19:01:10.864] [ info] [output:stdout:stdout.0] thread worker #0 stopped
[2026/05/01 19:01:10.927] [debug] [input:node_exporter_metrics:node_exporter_metrics.0] thread exit instance
  • Attached Valgrind output that shows no leaks or memory corruption was found

With leaks:

Process 96394 is not debuggable. Due to security restrictions, leaks can only show or save contents of readonly memory of restricted processes.

Process:         fluent-bit [96394]
Path:            /Users/USER/*/fluent-bit
Load Address:    0x1001ec000
Identifier:      fluent-bit
Version:         0
Code Type:       ARM64
Platform:        macOS
Parent Process:  leaks [96393]
Target Type:     live task

Date/Time:       2026-05-01 18:16:04.325 +0900
Launch Time:     2026-05-01 18:15:53.989 +0900
OS Version:      macOS 26.4.1 (25E253)
Report Version:  7
Analysis Tool:   /usr/bin/leaks

Physical footprint:         8000K
Physical footprint (peak):  8112K
Idle exit:                  untracked
----

leaks Report Version: 4.0, multi-line stacks
Process 96394: 1359 nodes malloced for 248 KB
Process 96394: 0 leaks for 0 total leaked bytes.

[2026/05/01 18:16:04] [engine] caught signal (SIGCONT)

With Valgrind:

==786817== 
==786817== HEAP SUMMARY:
==786817==     in use at exit: 0 bytes in 0 blocks
==786817==   total heap usage: 13,804 allocs, 13,804 frees, 11,723,588 bytes allocated
==786817== 
==786817== All heap blocks were freed -- no leaks are possible
==786817== 
==786817== For lists of detected and suppressed errors, rerun with: -s
==786817== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • New Features

    • Power-supply metrics collection added for Linux and macOS.
    • Filesystem metrics support added on macOS.
    • Netstat/network metrics expanded to expose additional dynamic network statistics.
  • Chores

    • Build and platform-specific configuration updated to include the new collectors.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new powersupply collector (Linux + macOS) and integrates it into build/initialization; introduces a Darwin filesystem collector; and extends the Linux netstat collector with lazy dynamic metrics (TcpExt/IpExt/IPv6), including allocation and teardown.

Changes

Cohort / File(s) Summary
Power Supply Collector
plugins/in_node_exporter_metrics/ne_powersupply.c, plugins/in_node_exporter_metrics/ne_powersupply.h, plugins/in_node_exporter_metrics/ne_powersupply_linux.c, plugins/in_node_exporter_metrics/ne_powersupply_darwin.c
Adds powersupplyclass collector and platform-specific implementations. Linux reads /sys/class/power_supply with lazy per-metric gauges and cleanup; Darwin queries IOKit/CoreFoundation and exports labeled gauges.
Build & Integration
plugins/in_node_exporter_metrics/CMakeLists.txt, plugins/in_node_exporter_metrics/ne.c, plugins/in_node_exporter_metrics/ne.h
Includes ne_powersupply.c in build, registers powersupply_collector in init, appends powersupplyclass to default metrics, and adds lists for dynamic metrics tracking (powersupply_dynamic_metrics, netstat_dynamic_metrics).
Filesystem (Darwin)
plugins/in_node_exporter_metrics/ne_filesystem.c, plugins/in_node_exporter_metrics/ne_filesystem_darwin.c
Adds Apple-specific filesystem collector using getmntinfo(), skip-regex filtering, and registers gauges for bytes/inodes/readonly/device_error; implements init/update/exit for Darwin.
Netstat Dynamic Metrics (Linux)
plugins/in_node_exporter_metrics/ne_netstat_linux.c
Implements lazy dynamic netstat gauges for TcpExt/IpExt and IPv6 metrics, reworks parsing across /proc/net/snmp, /proc/net/netstat, /proc/net/snmp6, filters static names, caches dynamic gauges in ctx->netstat_dynamic_metrics, and frees them on exit.

Sequence Diagram(s)

sequenceDiagram
    participant Collector as Netstat Collector
    participant ProcFS as /proc (snmp, netstat, snmp6)
    participant Registry as CMT Registry (dynamic gauges)
    Collector->>ProcFS: read /proc/net/snmp, /proc/net/netstat, /proc/net/snmp6
    ProcFS-->>Collector: header and value lines (Tcp, Udp, TcpExt, IpExt, snmp6)
    Collector->>Collector: build metric name "<proto>_<field>"
    Collector->>Registry: lookup or create dynamic gauge (cached)
    Registry-->>Collector: gauge handle
    Collector->>Registry: update gauge with value and labels
    Collector->>Registry: on exit -> destroy dynamic gauges and free names
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • edsiper
  • fujimotos
  • koleini

Poem

🐰 I hopped through sysfs and IOKit trees,
I read the counters, gauges, and tiny keys,
Netstat whispered TcpExt and IpExt lore,
Dynamic gauges sprung up and then some more,
Hooray — metrics bloom and data dances! ⚡

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title directly and clearly summarizes the main changes: implementing filesystem, EXT metrics, and powersupplyclass on the node exporter metrics plugin.
Linked Issues check ✅ Passed All code changes align with the primary objective: netstat collector now reads /proc/net/netstat and emits TcpExt_/IpExt_ metrics [#11763], plus additional filesystem and powersupplyclass collectors are implemented.
Out of Scope Changes check ✅ Passed Changes to netstat_dynamic_metrics in ne.h and ne_netstat_linux.c support the primary EXT metrics objective [#11763]; filesystem and powersupplyclass collectors are documented scope additions.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cosmo0920-implement-additional-metrics-on-node_exporter_metrics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cosmo0920 cosmo0920 changed the title in_node_exporter_metrics: implement additional metrics on node exporter metrics in_node_exporter_metrics: implement additional metrics (filesystem, EXT_* metrics, powersupplyclass) on node exporter metrics May 1, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7495556dc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/in_node_exporter_metrics/ne_powersupply_darwin.c Outdated
Comment thread plugins/in_node_exporter_metrics/ne_netstat_linux.c
Comment thread plugins/in_node_exporter_metrics/ne_powersupply_linux.c Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
plugins/in_node_exporter_metrics/ne_netstat_linux.c (1)

292-299: ⚡ Quick win

Move these new local declarations to the top of their functions.

The added parser blocks introduce mid-block declarations, which is off-style for this codebase and makes these functions inconsistent with the surrounding collector code.

As per coding guidelines "Declare variables at the start of functions, not mid-block".

Also applies to: 327-333, 472-482

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/in_node_exporter_metrics/ne_netstat_linux.c` around lines 292 - 299,
The new local variables declared mid-block (idx, d_val, metric, metric_name,
key, val) inside the NETSTAT_PROTO_TCPEXT/NETSTAT_PROTO_IPEXT parser branch
should be moved to the start of the enclosing function (e.g., the collector
function containing this proto switch) to match project style; find the same
pattern in the other parser blocks referenced (the similar blocks around the
ranges corresponding to lines 327-333 and 472-482) and relocate their variable
declarations to the top of their respective functions as well, keeping
initialization/assignments where they currently occur but ensuring all variable
declarations appear before any executable statements.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/in_node_exporter_metrics/ne_filesystem_darwin.c`:
- Around line 91-92: The init currently stores compiled regexes from
flb_regex_create into ctx->fs_regex_skip_mount and ctx->fs_regex_skip_fs_types
without checking for NULL; update the init routine so that after calling
flb_regex_create(ctx->fs_regex_ingore_mount_point_text) you verify
ctx->fs_regex_skip_mount is non-NULL, and if it is NULL return -1; then call
flb_regex_create(ctx->fs_regex_ingore_filesystem_type_text) and if that returns
NULL free the previously created ctx->fs_regex_skip_mount (cleanup) and return
-1; this ensures you never pass a NULL regex to flb_regex_match and properly
clean up on partial failure.

In `@plugins/in_node_exporter_metrics/ne_netstat_linux.c`:
- Around line 426-430: The current code returns early when
ne_utils_file_read_lines(ctx->path_procfs, "/net/netstat") fails, which prevents
subsequent handling of /net/snmp6; change the logic so that on ret == -1 you
skip parsing /net/netstat but do not return from the function (allow code to
continue into the /net/snmp6 handling), e.g., replace the return 0 with a branch
that leaves the list empty/cleared and continues; keep the calls to
mk_list_init(&list) and ensure any allocated resources for list are properly
cleaned up before proceeding to the /net/snmp6 read so you don’t leak memory and
still collect IPv6 counters from "/net/snmp6".

In `@plugins/in_node_exporter_metrics/ne_powersupply_darwin.c`:
- Around line 26-40: The listed file-static gauge pointers (ps_current_capacity,
ps_max_capacity, ps_design_capacity, ps_nominal_capacity, ps_time_to_empty,
ps_time_to_full, ps_voltage, ps_current, ps_temperature, ps_present,
ps_charging, ps_charged, ps_internal_failure, ps_battery_health) must be moved
into the instance context (struct flb_ne) so each node_exporter_metrics instance
has its own gauges; remove the file-static declarations in
ne_powersupply_darwin.c, add corresponding struct members to struct flb_ne
(e.g., struct cmt_gauge *ps_current_capacity; ...), update the code that
creates/registers the gauges to store them on ctx->ps_* (where ctx is the struct
flb_ne pointer used in init), and replace all uses of the old static symbols
with ctx->ps_* in the collector and update paths so each instance reads/writes
its own gauges. Ensure initialization and cleanup use the instance fields to
avoid cross-instance clobbering.

In `@plugins/in_node_exporter_metrics/ne_powersupply_linux.c`:
- Around line 32-33: ps_info and ps_dynamic_metrics are file-global and should
be per-instance; add fields (e.g., struct cmt_gauge *ps_info; struct mk_list
ps_dynamic_metrics;) to struct flb_ne, update ne_powersupply_init (or equivalent
init path) to initialize flb_ne->ps_info and flb_ne->ps_dynamic_metrics (use
mk_list_init on the instance list) and replace all references to the
file-statics with flb_ne->ps_info and flb_ne->ps_dynamic_metrics, and update
ne_powersupply_exit to clean up the instance’s gauge and dynamic metrics from
flb_ne (not the file-globals) so teardown only affects that instance; remove the
file-static declarations ps_info and ps_dynamic_metrics after updating call
sites.

In `@plugins/in_node_exporter_metrics/ne.h`:
- Around line 37-38: The macOS default metric set defined by the
NE_DEFAULT_ENABLED_METRICS macro under the __APPLE__ branch is missing the newly
added Darwin "filesystem" collector; update the NE_DEFAULT_ENABLED_METRICS
definition in the __APPLE__ block to include "filesystem" in the comma-separated
list so a stock node_exporter_metrics input on macOS enables the filesystem
collector by default.

---

Nitpick comments:
In `@plugins/in_node_exporter_metrics/ne_netstat_linux.c`:
- Around line 292-299: The new local variables declared mid-block (idx, d_val,
metric, metric_name, key, val) inside the
NETSTAT_PROTO_TCPEXT/NETSTAT_PROTO_IPEXT parser branch should be moved to the
start of the enclosing function (e.g., the collector function containing this
proto switch) to match project style; find the same pattern in the other parser
blocks referenced (the similar blocks around the ranges corresponding to lines
327-333 and 472-482) and relocate their variable declarations to the top of
their respective functions as well, keeping initialization/assignments where
they currently occur but ensuring all variable declarations appear before any
executable statements.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2d18b9a8-d3f2-481b-ae9a-d565c68e425b

📥 Commits

Reviewing files that changed from the base of the PR and between 1e69f37 and 7495556.

📒 Files selected for processing (10)
  • plugins/in_node_exporter_metrics/CMakeLists.txt
  • plugins/in_node_exporter_metrics/ne.c
  • plugins/in_node_exporter_metrics/ne.h
  • plugins/in_node_exporter_metrics/ne_filesystem.c
  • plugins/in_node_exporter_metrics/ne_filesystem_darwin.c
  • plugins/in_node_exporter_metrics/ne_netstat_linux.c
  • plugins/in_node_exporter_metrics/ne_powersupply.c
  • plugins/in_node_exporter_metrics/ne_powersupply.h
  • plugins/in_node_exporter_metrics/ne_powersupply_darwin.c
  • plugins/in_node_exporter_metrics/ne_powersupply_linux.c

Comment thread plugins/in_node_exporter_metrics/ne_filesystem_darwin.c
Comment thread plugins/in_node_exporter_metrics/ne_netstat_linux.c Outdated
Comment thread plugins/in_node_exporter_metrics/ne_powersupply_darwin.c Outdated
Comment thread plugins/in_node_exporter_metrics/ne_powersupply_linux.c Outdated
Comment thread plugins/in_node_exporter_metrics/ne.h Outdated
@cosmo0920 cosmo0920 force-pushed the cosmo0920-implement-additional-metrics-on-node_exporter_metrics branch from 7495556 to 463ae0d Compare May 1, 2026 09:24
@cosmo0920 cosmo0920 force-pushed the cosmo0920-implement-additional-metrics-on-node_exporter_metrics branch from 463ae0d to b0eb350 Compare May 1, 2026 09:28
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
plugins/in_node_exporter_metrics/ne_netstat_linux.c (1)

292-299: ⚡ Quick win

Hoist these new locals to the top of the function.

The added block-scoped declarations break the C style used in this plugin and make the parsing branches inconsistent with the rest of the file.

As per coding guidelines, "**/*.{c,cpp,cc,cxx}: Declare variables at the start of functions, not mid-block`."

Also applies to: 327-333, 472-482

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/in_node_exporter_metrics/ne_netstat_linux.c` around lines 292 - 299,
Hoist the block-scoped variables declared inside the NETSTAT_PROTO_TCPEXT /
NETSTAT_PROTO_IPEXT branch (int idx; double d_val; struct cmt_gauge *metric;
char metric_name[256]; struct flb_slist_entry *key; struct flb_slist_entry
*val;) to the top of the enclosing function so all local variables are declared
before any code, and apply the same change for the other similar branches (the
later blocks that declare locals mid-block). Keep the same names and types
(e.g., idx, d_val, metric, metric_name, key, val) and remove the in-block
declarations to match the file’s C style and coding guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/in_node_exporter_metrics/ne_powersupply_darwin.c`:
- Around line 229-231: The loop currently ignores update_power_source()'s return
value; change it to capture the return code, and if non-zero log the failure
(use the file's existing logging helper to include the
CFArrayGetValueAtIndex(list, i) or other identifying info) and continue
iterating; also set a local failure flag so the collector function can return a
non-zero status if any per-source parse failed instead of reporting overall
success.
- Around line 165-200: ne_powersupply_init currently ignores failures from
cmt_gauge_create and always returns success, which can later cause null
dereferences in ne_powersupply_update when cmt_gauge_set is called on a NULL
gauge; update ne_powersupply_init to check the return value of each
cmt_gauge_create (for ps_current_capacity, ps_max_capacity, ps_design_capacity,
ps_nominal_capacity, ps_time_to_empty, ps_time_to_full, ps_voltage, ps_current,
ps_temperature, ps_present, ps_charging, ps_charged, ps_internal_failure,
ps_battery_health) and if any is NULL, log an error and return a non-zero
failure code so initialization fails early. Ensure the function returns 0 only
if all gauges were created successfully.

---

Nitpick comments:
In `@plugins/in_node_exporter_metrics/ne_netstat_linux.c`:
- Around line 292-299: Hoist the block-scoped variables declared inside the
NETSTAT_PROTO_TCPEXT / NETSTAT_PROTO_IPEXT branch (int idx; double d_val; struct
cmt_gauge *metric; char metric_name[256]; struct flb_slist_entry *key; struct
flb_slist_entry *val;) to the top of the enclosing function so all local
variables are declared before any code, and apply the same change for the other
similar branches (the later blocks that declare locals mid-block). Keep the same
names and types (e.g., idx, d_val, metric, metric_name, key, val) and remove the
in-block declarations to match the file’s C style and coding guidelines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d37a4e23-43fd-4fae-a660-4befe68c70cb

📥 Commits

Reviewing files that changed from the base of the PR and between 7495556 and 463ae0d.

📒 Files selected for processing (10)
  • plugins/in_node_exporter_metrics/CMakeLists.txt
  • plugins/in_node_exporter_metrics/ne.c
  • plugins/in_node_exporter_metrics/ne.h
  • plugins/in_node_exporter_metrics/ne_filesystem.c
  • plugins/in_node_exporter_metrics/ne_filesystem_darwin.c
  • plugins/in_node_exporter_metrics/ne_netstat_linux.c
  • plugins/in_node_exporter_metrics/ne_powersupply.c
  • plugins/in_node_exporter_metrics/ne_powersupply.h
  • plugins/in_node_exporter_metrics/ne_powersupply_darwin.c
  • plugins/in_node_exporter_metrics/ne_powersupply_linux.c
✅ Files skipped from review due to trivial changes (2)
  • plugins/in_node_exporter_metrics/CMakeLists.txt
  • plugins/in_node_exporter_metrics/ne_powersupply.h
🚧 Files skipped from review as they are similar to previous changes (5)
  • plugins/in_node_exporter_metrics/ne.c
  • plugins/in_node_exporter_metrics/ne_powersupply.c
  • plugins/in_node_exporter_metrics/ne_powersupply_linux.c
  • plugins/in_node_exporter_metrics/ne_filesystem_darwin.c
  • plugins/in_node_exporter_metrics/ne.h

Comment thread plugins/in_node_exporter_metrics/ne_netstat_linux.c
Comment thread plugins/in_node_exporter_metrics/ne_powersupply_darwin.c
Comment thread plugins/in_node_exporter_metrics/ne_powersupply_darwin.c
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (4)
plugins/in_node_exporter_metrics/ne.h (1)

38-38: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Include filesystem in macOS default enabled metrics.

Line 38 omits filesystem, so the new Darwin filesystem collector is not enabled in the default macOS metric set.

Suggested fix
-#define NE_DEFAULT_ENABLED_METRICS "cpu,loadavg,meminfo,diskstats,uname,netdev,powersupplyclass"
+#define NE_DEFAULT_ENABLED_METRICS "cpu,loadavg,meminfo,diskstats,filesystem,uname,netdev,powersupplyclass"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/in_node_exporter_metrics/ne.h` at line 38, The
NE_DEFAULT_ENABLED_METRICS macro currently omits the Darwin filesystem
collector; update the macro NE_DEFAULT_ENABLED_METRICS to include "filesystem"
in the comma-separated list (e.g.,
"cpu,loadavg,meminfo,diskstats,uname,netdev,powersupplyclass,filesystem" or
insert "filesystem" where appropriate) so the macOS default metric set enables
the new filesystem collector.
plugins/in_node_exporter_metrics/ne_powersupply_darwin.c (2)

214-216: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Do not ignore update_power_source() failures in the update loop.

Line 215 drops the return code, so scrape can report success even when one or more power sources fail to parse.

Suggested fix
-    for (i = 0; i < CFArrayGetCount(list); i++) {
-        update_power_source(ctx, CFArrayGetValueAtIndex(list, i), info, ts);
-    }
+    {
+        int had_error;
+        int rc;
+
+        had_error = FLB_FALSE;
+        for (i = 0; i < CFArrayGetCount(list); i++) {
+            rc = update_power_source(ctx, CFArrayGetValueAtIndex(list, i), info, ts);
+            if (rc != 0) {
+                had_error = FLB_TRUE;
+            }
+        }
+
+        if (had_error == FLB_TRUE) {
+            CFRelease(list);
+            CFRelease(info);
+            return -1;
+        }
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/in_node_exporter_metrics/ne_powersupply_darwin.c` around lines 214 -
216, The loop currently ignores update_power_source() return values so failures
are lost; change the loop to capture each call's return (e.g., int rc =
update_power_source(ctx, CFArrayGetValueAtIndex(list, i), info, ts);) and track
an overall status (e.g., int overall_rc = 0; if (rc != 0) overall_rc = rc or
overall_rc = 1;) then after the CFArray loop return or propagate overall_rc
instead of blindly returning success; ensure you use the existing
update_power_source symbol and the CFArrayGetValueAtIndex(list, i) call sites
when implementing this change so any parsing errors are surfaced.

150-186: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fail init when any gauge registration returns NULL.

Line 154 onward creates required gauges, but Line 185 always returns success. If any cmt_gauge_create fails, later update paths can dereference NULL metric pointers.

Suggested fix
 static int ne_powersupply_init(struct flb_ne *ctx)
 {
     char *label[] = {"power_supply"};
@@
     ctx->darwin_ps_battery_health = cmt_gauge_create(ctx->cmt, "node", "powersupply", "battery_health",
                                          "Power supply battery health status.", 2,
                                          (char *[]) {"power_supply", "state"});
+
+    if (ctx->darwin_ps_current_capacity == NULL ||
+        ctx->darwin_ps_max_capacity == NULL ||
+        ctx->darwin_ps_design_capacity == NULL ||
+        ctx->darwin_ps_nominal_capacity == NULL ||
+        ctx->darwin_ps_time_to_empty == NULL ||
+        ctx->darwin_ps_time_to_full == NULL ||
+        ctx->darwin_ps_voltage == NULL ||
+        ctx->darwin_ps_current == NULL ||
+        ctx->darwin_ps_temperature == NULL ||
+        ctx->darwin_ps_present == NULL ||
+        ctx->darwin_ps_charging == NULL ||
+        ctx->darwin_ps_charged == NULL ||
+        ctx->darwin_ps_internal_failure == NULL ||
+        ctx->darwin_ps_battery_health == NULL) {
+        flb_plg_error(ctx->ins, "could not initialize one or more powersupply metrics");
+        return -1;
+    }
 
     return 0;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/in_node_exporter_metrics/ne_powersupply_darwin.c` around lines 150 -
186, ne_powersupply_init currently ignores failures from cmt_gauge_create and
always returns success; update ne_powersupply_init to check the return of each
cmt_gauge_create for NULL (e.g., ctx->darwin_ps_current_capacity,
ctx->darwin_ps_max_capacity, ..., ctx->darwin_ps_battery_health) and if any is
NULL, log an error and return a failure code (non-zero) after cleaning up any
gauges already created; ensure you reference the cmt_gauge_create calls and the
ctx->darwin_ps_* fields when implementing the checks and cleanup.
plugins/in_node_exporter_metrics/ne_netstat_linux.c (1)

74-121: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use counter-backed dynamic metrics for TcpExt/IpExt metrics.

On Line 108 dynamic metrics are created as gauges, and on Line 322 Ext values are written with cmt_gauge_set. For node_netstat_TcpExt_* / node_netstat_IpExt_*, this exports the wrong Prometheus type versus the PR objective (counters).

Also applies to: 292-323

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/in_node_exporter_metrics/ne_netstat_linux.c` around lines 74 - 121,
The dynamic metric creation currently always makes gauges in
netstat_dynamic_metric_get and later uses cmt_gauge_set; change creation and
storage to counters for the TcpExt/IpExt metrics: detect when the incoming name
starts with "TcpExt" or "IpExt" and call cmt_counter_create instead of
cmt_gauge_create, store the result in a counter pointer field on struct
netstat_dynamic_metric (replace or add a struct cmt_counter *counter field and
stop using struct cmt_gauge *gauge for these names), and update all places that
set these metrics (where cmt_gauge_set is used around the code handling Ext
values, e.g. the block referenced 292-323) to call cmt_counter_set for
counter-backed entries; keep gauge creation/setting for other metric names.
Ensure NULL checks and list insertion behavior remain the same.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/in_node_exporter_metrics/ne_filesystem_darwin.c`:
- Around line 89-152: ne_filesystem_init currently returns early on
cmt_gauge_create failures and leaks the compiled regex handles
(ctx->fs_regex_skip_mount and ctx->fs_regex_skip_fs_types); change the function
to funnel all error exits through a single cleanup path that calls
ne_filesystem_exit (or explicitly flb_regex_destroy for the two regexes) before
returning -1 so any partially-initialized resources are freed; locate
ne_filesystem_init and update each failing cmt_gauge_create branch to goto a
cleanup label (or call ne_filesystem_exit) instead of returning immediately,
ensuring regex handles are destroyed and
ctx->fs_regex_skip_mount/ctx->fs_regex_skip_fs_types are nulled.

---

Duplicate comments:
In `@plugins/in_node_exporter_metrics/ne_netstat_linux.c`:
- Around line 74-121: The dynamic metric creation currently always makes gauges
in netstat_dynamic_metric_get and later uses cmt_gauge_set; change creation and
storage to counters for the TcpExt/IpExt metrics: detect when the incoming name
starts with "TcpExt" or "IpExt" and call cmt_counter_create instead of
cmt_gauge_create, store the result in a counter pointer field on struct
netstat_dynamic_metric (replace or add a struct cmt_counter *counter field and
stop using struct cmt_gauge *gauge for these names), and update all places that
set these metrics (where cmt_gauge_set is used around the code handling Ext
values, e.g. the block referenced 292-323) to call cmt_counter_set for
counter-backed entries; keep gauge creation/setting for other metric names.
Ensure NULL checks and list insertion behavior remain the same.

In `@plugins/in_node_exporter_metrics/ne_powersupply_darwin.c`:
- Around line 214-216: The loop currently ignores update_power_source() return
values so failures are lost; change the loop to capture each call's return
(e.g., int rc = update_power_source(ctx, CFArrayGetValueAtIndex(list, i), info,
ts);) and track an overall status (e.g., int overall_rc = 0; if (rc != 0)
overall_rc = rc or overall_rc = 1;) then after the CFArray loop return or
propagate overall_rc instead of blindly returning success; ensure you use the
existing update_power_source symbol and the CFArrayGetValueAtIndex(list, i) call
sites when implementing this change so any parsing errors are surfaced.
- Around line 150-186: ne_powersupply_init currently ignores failures from
cmt_gauge_create and always returns success; update ne_powersupply_init to check
the return of each cmt_gauge_create for NULL (e.g.,
ctx->darwin_ps_current_capacity, ctx->darwin_ps_max_capacity, ...,
ctx->darwin_ps_battery_health) and if any is NULL, log an error and return a
failure code (non-zero) after cleaning up any gauges already created; ensure you
reference the cmt_gauge_create calls and the ctx->darwin_ps_* fields when
implementing the checks and cleanup.

In `@plugins/in_node_exporter_metrics/ne.h`:
- Line 38: The NE_DEFAULT_ENABLED_METRICS macro currently omits the Darwin
filesystem collector; update the macro NE_DEFAULT_ENABLED_METRICS to include
"filesystem" in the comma-separated list (e.g.,
"cpu,loadavg,meminfo,diskstats,uname,netdev,powersupplyclass,filesystem" or
insert "filesystem" where appropriate) so the macOS default metric set enables
the new filesystem collector.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fde9a8af-3268-4b15-a71e-cee9a688de45

📥 Commits

Reviewing files that changed from the base of the PR and between b0eb350 and fbbb283.

📒 Files selected for processing (10)
  • plugins/in_node_exporter_metrics/CMakeLists.txt
  • plugins/in_node_exporter_metrics/ne.c
  • plugins/in_node_exporter_metrics/ne.h
  • plugins/in_node_exporter_metrics/ne_filesystem.c
  • plugins/in_node_exporter_metrics/ne_filesystem_darwin.c
  • plugins/in_node_exporter_metrics/ne_netstat_linux.c
  • plugins/in_node_exporter_metrics/ne_powersupply.c
  • plugins/in_node_exporter_metrics/ne_powersupply.h
  • plugins/in_node_exporter_metrics/ne_powersupply_darwin.c
  • plugins/in_node_exporter_metrics/ne_powersupply_linux.c
✅ Files skipped from review due to trivial changes (4)
  • plugins/in_node_exporter_metrics/CMakeLists.txt
  • plugins/in_node_exporter_metrics/ne_powersupply.h
  • plugins/in_node_exporter_metrics/ne_filesystem.c
  • plugins/in_node_exporter_metrics/ne_powersupply.c
🚧 Files skipped from review as they are similar to previous changes (2)
  • plugins/in_node_exporter_metrics/ne.c
  • plugins/in_node_exporter_metrics/ne_powersupply_linux.c

Comment thread plugins/in_node_exporter_metrics/ne_filesystem_darwin.c
cosmo0920 added 4 commits May 1, 2026 19:12
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@cosmo0920 cosmo0920 force-pushed the cosmo0920-implement-additional-metrics-on-node_exporter_metrics branch from dc7a1a4 to c785d9d Compare May 1, 2026 10:12
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

in_node_exporter_metrics: netstat collector missing TcpExt_*/IpExt_* from /proc/net/netstat

1 participant