node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

Darwin M1 temperature reading via SMC

Open sepich opened this issue 2 years ago • 3 comments

Host operating system: output of uname -a

Darwin de-unit-1032.mu4 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103 arm64

node_exporter version: output of node_exporter --version

node_exporter, version 1.3.1 (branch: HEAD, revision: a2321e7b940ddcff26873612bccdf7cd4c42b6b6)
  build user:       root@e7da778d77e0
  build date:       20211205-11:13:28
  go version:       go1.17.3
  platform:         darwin/arm64

Are you running node_exporter in Docker?

no

What did you expect to see?

This is a feature request to support reading temperature/fans metrics from Apple SMC. This is currently seems to be a universal solution for both Intel and Apple Silicon hardware. Example of working go code could be seen in: https://github.com/dkorunic/iSMC I believe this support would be highly appreciated by all of the mac farm build agents owners.

What did you see instead?

No any temperature reading from node_exporter on darwin.

sepich avatar Mar 21 '23 17:03 sepich

It's worth noting that while github.com/dkorunic/iSMC is the user-facing command-line tool for displaying the metrics, the actual interfacing with the SMC system is done by github.com/panotza/gosmc - which is a Go wrapper around the SMC library (i.e., relies heavily on cgo).

dswarbrick avatar Mar 23 '23 00:03 dswarbrick

We allow CGO for Darwin, since there's a bunch of stuff that require it.

SuperQ avatar Mar 25 '23 12:03 SuperQ