Skip to content

Commit 65217f2

Browse files
Add macOS thermal check reading AppleSMC/IOHID sensors and thermal pressure level
Adds a darwin-specific implementation of the thermal corecheck that reads CPU/GPU/SSD/battery temperatures via AppleSMC and PMU/NAND/battery/MTR sensors via IOHIDEventSystemClient, plus the macOS thermal pressure level via the private com.apple.system.thermalpressurelevel notification.
1 parent daf42da commit 65217f2

5 files changed

Lines changed: 925 additions & 1 deletion

File tree

pkg/collector/corechecks/system/thermal/BUILD.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ load("//bazel/rules/go:dd_agent_go_test.bzl", "dd_agent_go_test")
44
go_library(
55
name = "thermal",
66
srcs = [
7+
"thermal_darwin.c",
8+
"thermal_darwin.go",
9+
"thermal_darwin.h",
710
"thermal_stub.go",
811
"thermal_windows.go",
912
],
13+
cgo = True,
14+
clinkopts = select({
15+
"@rules_go//go/platform:darwin": [
16+
"-framework IOKit -framework CoreFoundation",
17+
],
18+
"//conditions:default": [],
19+
}),
1020
importpath = "github.com/DataDog/datadog-agent/pkg/collector/corechecks/system/thermal",
1121
visibility = ["//visibility:public"],
1222
deps = select({
@@ -19,7 +29,11 @@ go_library(
1929
"//pkg/util/option",
2030
],
2131
"@rules_go//go/platform:darwin": [
32+
"//comp/core/autodiscovery/integration",
33+
"//pkg/aggregator/sender",
2234
"//pkg/collector/check",
35+
"//pkg/collector/corechecks",
36+
"//pkg/util/log",
2337
"//pkg/util/option",
2438
],
2539
"@rules_go//go/platform:dragonfly": [

0 commit comments

Comments
 (0)