prometheus / node_exporter

Exporter for machine metrics
https://prometheus.io/
Apache License 2.0
11.29k stars 2.37k forks source link

several collectors fail on OpenBSD 7.5 #3084

Open GBBx opened 3 months ago

GBBx commented 3 months ago

Host operating system: output of uname -a

OpenBSD hostname 7.5 GENERIC.MP#82 amd64

node_exporter version: output of node_exporter --version

node_exporter, version 1.7.0 (branch: non-git, revision: non-git)
  build user:       openbsd_ports
  build date:       2024-03-15
  go version:       go1.22.1
  platform:         openbsd/amd64
  tags:             unknown

node_exporter command line flags

--collector.textfile.directory='/var/node_exporter/textfile_collector'

node_exporter log output

caller=collector.go:169 level=error msg="collector failed" name=filesystem duration_seconds=5.838e-06 err="function not implemented"
caller=collector.go:169 level=error msg="collector failed" name=netdev duration_seconds=6.702e-06 err="couldn't get netstats: function not implemented"
caller=collector.go:169 level=error msg="collector failed" name=meminfo duration_seconds=1.2519e-05 err="couldn't get meminfo: function not implemented"

Are you running node_exporter in Docker?

No.

What did you do that produced an error?

I updated OpenBSD from 7.3 to 7.5 and node_exporter from 1.5.0 to 1.7.0. These collectors worked on the old versions.

What did you expect to see?

The collectors should still work.

What did you see instead?

The filesystem, os, netdev and meminfo collectors fail (I can't errors in the log about the OS collector).

curl localhost:9100/metrics -s | grep "^node.*success"
node_scrape_collector_success{collector="boottime"} 1
node_scrape_collector_success{collector="cpu"} 1
node_scrape_collector_success{collector="diskstats"} 1
node_scrape_collector_success{collector="filesystem"} 0
node_scrape_collector_success{collector="loadavg"} 1
node_scrape_collector_success{collector="meminfo"} 0
node_scrape_collector_success{collector="netdev"} 0
node_scrape_collector_success{collector="os"} 0
node_scrape_collector_success{collector="textfile"} 1
node_scrape_collector_success{collector="time"} 1
node_scrape_collector_success{collector="uname"} 1
JimmyFan24 commented 3 months ago

Could you open debug mode and get more debug logs of these collector? It seems like a syscall compatibility problem

greenfork commented 2 months ago

I don't see any errors in the log

# uname -a                                                                   
OpenBSD fox.my.domain 7.5 GENERIC.MP#138 arm64

# node_exporter --version                                                    
node_exporter, version 1.7.0 (branch: non-git, revision: non-git)                                         
  build user:       openbsd_ports                                                                         
  build date:       2024-03-21                                                                            
  go version:       go1.22.1                                                                              
  platform:         openbsd/arm64                                                                         
  tags:             unknown

But I also don't have an OS collector active

# curl localhost:9100/metrics -s | grep "^node.*success"
node_scrape_collector_success{collector="boottime"} 1
node_scrape_collector_success{collector="cpu"} 1
node_scrape_collector_success{collector="diskstats"} 1
node_scrape_collector_success{collector="filesystem"} 1
node_scrape_collector_success{collector="loadavg"} 1
node_scrape_collector_success{collector="meminfo"} 1
node_scrape_collector_success{collector="netdev"} 1
node_scrape_collector_success{collector="os"} 0
node_scrape_collector_success{collector="textfile"} 1
node_scrape_collector_success{collector="time"} 1
node_scrape_collector_success{collector="uname"} 1

Here is a debug log with collector=os:

ts=2024-09-01T20:33:01.244Z caller=os_release.go:183 level=debug collector=os msg="no os-release
file found" files=/etc/os-release,/usr/lib/os-release,/System/Library/CoreServices/SystemVersion.plist
GBBx commented 2 months ago

@JimmyFan24 , thanks for the hint and sorry for the delay. Yes, the debug mode solves most of the collectors and only the "os" collector failed.

GBBx commented 2 months ago

As far as I can see, there's no os-release file in OpenBSD and the only way to get the OS version is by uname.

discordianfish commented 2 months ago

So you're saying that normally these collectors fail but with debug logging enabled they don't? Can you please double check? That seems unlikely..