Sample Header Ad - 728x90

pfSense (FreeBSD 14.0) - Prometheus Node Exporter gives log errors - fix or suppress in log

2 votes
1 answer
682 views
On pfSense, I've enabled Prometheus Node Exporter, but it gives the following log errors each 15 seconds: Feb 15 09:53:57 vault node_exporter: ts=2024-02-15T08:53:57.164Z caller=collector.go:169 level=error msg="collector failed" name=uname duration_seconds=1.9687e-05 err="cannot allocate memory" Feb 15 09:53:57 vault node_exporter: ts=2024-02-15T08:53:57.164Z caller=collector.go:169 level=error msg="collector failed" name=zfs duration_seconds=1.6108e-05 err="couldn't get sysctl: no such file or directory" This is my Node Exporter settings: enter image description here I'm not sure which collector gives the errors (on second thought, it seems to be some collectors that are not enabled, but still trying to collect). In any case, if I need it I might not be able to disable it, so another option would be to suppress the error messages in the log. I've tried: - Setting --log.level=none, but this is apparently not a valid log level - Creating a 01-node-exporter.conf file to suppress the messages, like this: if $msg contains "collector failed" then { stop } And put it inside /var/etc/syslog.d/. But this doesn't seem to suppress the messages either (this is working for me on Ubuntu). - I also tried [this advice](https://www.rsyslog.com/discarding-unwanted-messages/) , and instead put this into the 01-node-exporter.conf file, but to no avail: :msg, contains, "collector failed" ~ In addition, I've found the node_exporter config file, which is located at /usr/local/etc/rc.conf.d. This file contains: # This file is generated by the pfSense node_exporter package. # Do not edit this file, it will be overwritten automatically. node_exporter_enable="YES" node_exporter_listen_address="10.10.1.1:9100" node_exporter_args=" --collector.boottime --collector.cpu --collector.exec --collector.filesystem --collector.loadavg --collector.meminfo --collector.netdev --collector.textfile --collector.time --log.level=error" I'm inclined to think the erroneous log messages is a bug in Node Exporter for FreeBSD (because the collectors uname and zfs doesn't even seem to be enabled), so the short term solution would be to suppress the log messages.
Asked by Artur Meinild (792 rep)
Feb 15, 2024, 09:01 AM
Last activity: Feb 23, 2024, 05:20 PM