You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# cat /etc/default/prometheus-node-exporter
# Set the command-line arguments to pass to the server.
# Due to shell escaping, to pass backslashes for regexes, you need to double
# them (\\d for \d). If running under systemd, you need to double them again
# (\\\\d to mean \d), and escape newlines too.
ARGS=""
node_exporter log output
This line repeats:
May 16 10:19:56 node1 prometheus-node-exporter[1064]: ts=2024-05-16T08:19:56.181Z caller=collector.go:169 level=error msg="collector failed" name=powersupplyclass duration_seconds=0.006216025 err="could not get power_supply class info: error obtaining power_supply class info: failed to read file \"/sys/class/power_supply/BAT0/charge_control_end_threshold\": no such device"
Are you running node_exporter in Docker?
no
What did you do that produced an error?
started node exporter
What did you expect to see?
no error and battery stats in metrics
What did you see instead?
error and no battery stats in metrics
Some potentially useful info:
# ls -l /sys/class/power_supply/BAT0/
total 0
-rw-r--r-- 1 root root 4096 May 16 10:18 alarm
-r--r--r-- 1 root root 4096 May 16 10:18 capacity
-r--r--r-- 1 root root 4096 May 16 10:18 capacity_level
-rw-r--r-- 1 root root 4096 May 16 10:18 charge_behaviour
-rw-r--r-- 1 root root 4096 May 16 10:18 charge_control_end_threshold
-rw-r--r-- 1 root root 4096 May 16 10:18 charge_control_start_threshold
-rw-r--r-- 1 root root 4096 May 16 10:35 charge_start_threshold
-rw-r--r-- 1 root root 4096 May 16 10:35 charge_stop_threshold
-r--r--r-- 1 root root 4096 May 16 10:35 cycle_count
lrwxrwxrwx 1 root root 0 May 16 10:17 device -> ../../../PNP0C0A:00
-r--r--r-- 1 root root 4096 May 16 10:35 energy_full
-r--r--r-- 1 root root 4096 May 16 10:35 energy_full_design
-r--r--r-- 1 root root 4096 May 16 10:35 energy_now
drwxr-xr-x 3 root root 0 May 16 10:17 hwmon1
-r--r--r-- 1 root root 4096 May 16 10:35 manufacturer
-r--r--r-- 1 root root 4096 May 16 10:35 model_name
drwxr-xr-x 2 root root 0 May 16 10:18 power
-r--r--r-- 1 root root 4096 May 16 10:35 power_now
-r--r--r-- 1 root root 4096 May 16 10:17 present
-r--r--r-- 1 root root 4096 May 16 10:35 serial_number
-r--r--r-- 1 root root 4096 May 16 10:17 status
lrwxrwxrwx 1 root root 0 May 16 10:17 subsystem -> ../../../../../../../../../class/power_supply
-r--r--r-- 1 root root 4096 May 16 10:35 technology
-r--r--r-- 1 root root 4096 May 16 10:17 type
-rw-r--r-- 1 root root 4096 May 16 10:17 uevent
-r--r--r-- 1 root root 4096 May 16 10:35 voltage_min_design
-r--r--r-- 1 root root 4096 May 16 10:35 voltage_now
# cat /sys/class/power_supply/BAT0/charge_control_end_threshold
cat: /sys/class/power_supply/BAT0/charge_control_end_threshold: No such device
This would need to be expanded to handle the ENODEV returned when trying to read the charge_control_end_threshold file.
I have previously advised against this approach of "read every file and see what sticks", since it is inherently fragile. New entries are regularly appearing in sysfs, and applying such a generic approach often leads to failures like this. It might be a little more work to explicitly specify which files to read, rather than just globbing over a very liberal wildcard pattern, but it results in more robust code that won't freak out when something new appears.
Host operating system: output of
uname -a
Linux node1 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux
node_exporter version: output of
node_exporter --version
node_exporter, version 1.8.0 (branch: debian/sid, revision: 1.8.0-1)
build user: [email protected]
build date: 20240424-20:05:35
go version: go1.22.2
platform: linux/amd64
tags: unknown
node_exporter command line flags
It's started with systemd using:
and
$ARGS
is empty:node_exporter log output
This line repeats:
Are you running node_exporter in Docker?
no
What did you do that produced an error?
started node exporter
What did you expect to see?
no error and battery stats in metrics
What did you see instead?
error and no battery stats in metrics
Some potentially useful info:
The text was updated successfully, but these errors were encountered: