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
{{ message }}
Repository navigation
err="no CPU power status has been recorded" on M3 #2906
dongjiang@MacBook Pro:prometheus-operator $ pmset -g thermlog
Note: No thermal warning level has been recorded
Note: No performance warning level has been recorded
Note: No CPU power status has been recorded
I was able to reproduce this issue on master, however, I don't think this bug is within the scope of node_exporter, but instead, needs to be addressed from the IOPMCopyCPUPowerStatus side of things (the underlying API the thermal collector relies on for this data).
It's also worth mentioning here that all recommended practices mentioned in the same documentation are being followed in the repository (such as releasing allocated CFDictionaryRef memory and checking for returned error codes).
A simplified version of the C-based collection logic shows that while node_exporter is responsible for exposing the data, it's the response from the API that is unexpected in nature.
I'd like to pick this up, with a narrower scope than the original report.
@rexagod is right that the missing data itself can't be fixed from here — IOPMCopyCPUPowerStatus genuinely returns kIOReturnNotFound on Apple Silicon and there's nothing node_exporter can do about that. But there's a separate problem on our side that I think is worth fixing: because Update returns that error immediately, the temperature sensors read further down are never collected either.
Reproduced on an M5 Pro (darwin/arm64, current master):
fetchCPUPowerStatus() -> status=map[] err=no CPU power status has been recorded
Update() -> err=no CPU power status has been recorded ; metrics emitted=0
IsNoDataError(err) -> false
updateTemperatures() alone -> err=<nil> ; temperature metrics available=52
So there are 52 working temperature sensors on this machine that never make it out, and since the error isn't ErrNoData it's logged at error level on every scrape rather than debug.
The change I have locally treats kIOReturnNotFound as "this system doesn't report CPU power status" instead of a failure: skip the three CPU power metrics, log at debug, and carry on to the temperatures. Any other non-success return code is still returned as an error as before.
cpuPowerStatus, err:=fetchCPUPowerStatus()
switch {
caseerr==nil:
// ... emit the three CPU power metrics as beforecaseerrors.Is(err, errNoCPUPowerStatus):
// Apple Silicon does not report CPU power status. The temperature// sensors collected below are still available, so this must not abort// the collector.c.logger.Debug("No CPU power status reported by the system, skipping CPU power metrics")
default:
returnerr
}
returnc.updateTemperatures(ch)
After the change, Update() on the same machine returns no error and emits all 52 temperature metrics. On Intel Macs, where the CPU power status is available, nothing changes.
I've added a regression test (collector/thermal_darwin_test.go) that fails on master and passes with the fix. go build ./..., go vet ./collector/, gofmt and the full ./collector/ suite are all clean.
Worth noting this doesn't close #2218 or make the CPU power metrics appear on Apple Silicon — those still won't exist. It just stops their absence from taking the temperature metrics down with them. Happy to adjust the scope if you'd rather handle it differently.
Activity
dongjiang1989 commentedon Mar 6, 2024
--no-collector.thermaldisable on M1, M2, M3ref: #2218
rexagod commentedon Mar 17, 2024
I was able to reproduce this issue on
master, however, I don't think this bug is within the scope ofnode_exporter, but instead, needs to be addressed from theIOPMCopyCPUPowerStatusside of things (the underlying API the thermal collector relies on for this data).It's also worth mentioning here that all recommended practices mentioned in the same documentation are being followed in the repository (such as releasing allocated
CFDictionaryRefmemory and checking for returned error codes).A simplified version of the C-based collection logic shows that while
node_exporteris responsible for exposing the data, it's the response from the API that is unexpected in nature.Additionally,
ioreg -n IOPMrootDomain -r | grep IOPMCPUPowerLimitProcessorSpeedKeyfails as well.SaiPisey2 commentedon Jul 31, 2026
I'd like to pick this up, with a narrower scope than the original report.
@rexagod is right that the missing data itself can't be fixed from here —
IOPMCopyCPUPowerStatusgenuinely returnskIOReturnNotFoundon Apple Silicon and there's nothing node_exporter can do about that. But there's a separate problem on our side that I think is worth fixing: becauseUpdatereturns that error immediately, the temperature sensors read further down are never collected either.Reproduced on an M5 Pro (darwin/arm64, current master):
So there are 52 working temperature sensors on this machine that never make it out, and since the error isn't
ErrNoDatait's logged at error level on every scrape rather than debug.The change I have locally treats
kIOReturnNotFoundas "this system doesn't report CPU power status" instead of a failure: skip the three CPU power metrics, log at debug, and carry on to the temperatures. Any other non-success return code is still returned as an error as before.After the change,
Update()on the same machine returns no error and emits all 52 temperature metrics. On Intel Macs, where the CPU power status is available, nothing changes.I've added a regression test (
collector/thermal_darwin_test.go) that fails on master and passes with the fix.go build ./...,go vet ./collector/, gofmt and the full./collector/suite are all clean.Worth noting this doesn't close #2218 or make the CPU power metrics appear on Apple Silicon — those still won't exist. It just stops their absence from taking the temperature metrics down with them. Happy to adjust the scope if you'd rather handle it differently.
fix(darwin,illumos): make thermal and CPU collectors robust on Apple …