{"id":100787,"date":"2026-09-05T10:17:28","date_gmt":"2026-09-05T02:17:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/100787.html"},"modified":"2026-09-05T10:17:28","modified_gmt":"2026-09-05T02:17:28","slug":"prometheus-%e7%9b%91%e6%8e%a7-macos-%e5%85%a8%e6%a0%88%e5%ae%9e%e6%88%98%ef%bc%9a%e4%bb%8e%e7%a1%ac%e4%bb%b6%e6%b8%a9%e5%ba%a6%e5%88%b0%e7%b3%bb%e7%bb%9f%e8%b4%9f%e8%bd%bd%e7%9a%84%e8%8b%b9%e6%9e%9c","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/100787.html","title":{"rendered":"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027"},"content":{"rendered":"<h3>Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218&#xff1a;\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027<\/h3>\n<hr \/>\n<p>\u5728\u6df7\u5408\u529e\u516c\u4e0e DevOps \u6d41\u6c34\u7ebf\u4e2d&#xff0c;macOS \u8bbe\u5907\u6b63\u627f\u62c5\u7740\u8d8a\u6765\u8d8a\u591a\u7684\u5173\u952e\u89d2\u8272&#xff1a;iOS \u6784\u5efa\u8282\u70b9\u3001\u5f00\u53d1\u8005\u5de5\u4f5c\u7ad9\u3001\u6301\u7eed\u96c6\u6210 runner\u3002\u4e00\u65e6\u5b83\u7684 CPU \u8d1f\u8f7d\u98d9\u5347\u3001\u5185\u5b58\u538b\u529b\u6fd2\u4e34\u7ea2\u8272\u3001\u78c1\u76d8\u7a7a\u95f4\u67af\u7aed\u3001\u7535\u6c60\u5065\u5eb7\u4e0b\u964d\u6216\u6e29\u5ea6\u5f02\u5e38&#xff0c;\u8f7b\u5219\u62d6\u6162\u5f00\u53d1\u8fdb\u5ea6&#xff0c;\u91cd\u5219\u963b\u585e\u6574\u4e2a\u53d1\u5e03\u6d41\u6c34\u7ebf\u3002Prometheus \u901a\u8fc7\u5b98\u65b9 node_exporter&#xff08;\u5929\u7136\u652f\u6301 Darwin \u5185\u6838&#xff09;\u4ee5\u53ca\u793e\u533a osx_exporter&#xff0c;\u80fd\u5c06 macOS \u7684\u7cfb\u7edf\u6307\u6807\u8f6c\u5316\u4e3a\u6807\u51c6 Prometheus \u65f6\u5e8f\u6570\u636e&#xff0c;\u8ba9\u82f9\u679c\u8bbe\u5907\u4e5f\u5b8c\u5168\u878d\u5165\u4f60\u7684\u5168\u6808\u53ef\u89c2\u6d4b\u4f53\u7cfb\u3002\u672c\u6587\u5c06\u5e26\u4f60\u4ece\u5b89\u88c5\u5bfc\u51fa\u5668\u3001\u914d\u7f6e LaunchDaemon\u3001\u5230\u89e3\u8bfb\u6838\u5fc3\u6307\u6807\u3001\u521b\u5efa Grafana \u5927\u5c4f\u4e0e\u544a\u8b66\u843d\u5730&#xff0c;\u8ba9\u4f60\u7684 Mac \u50cf\u670d\u52a1\u5668\u4e00\u6837\u88ab\u6089\u5fc3\u76d1\u63a7\u3002<\/p>\n<hr \/>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260905021721-6a9b7bb1b4841.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>1. \u65b9\u6848\u9009\u578b&#xff1a;node_exporter vs osx_exporter<\/h4>\n<table>\n<tr>\u7ec4\u4ef6\u9002\u7528\u573a\u666f\u7279\u70b9<\/tr>\n<tbody>\n<tr>\n<td>node_exporter&#xff08;\u5b98\u65b9\u63a8\u8350&#xff09;<\/td>\n<td>CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u3001\u6587\u4ef6\u7cfb\u7edf\u3001\u7cfb\u7edf\u8d1f\u8f7d\u7b49\u5e38\u89c4 OS \u6307\u6807<\/td>\n<td>Prometheus \u5b98\u65b9\u9879\u76ee&#xff0c;\u76f4\u63a5\u63d0\u4f9b macOS \u4e8c\u8fdb\u5236&#xff0c;\u65e0\u9700\u989d\u5916\u5f00\u53d1&#xff1b;\u8986\u76d6 Linux \u76d1\u63a7\u7684\u5e38\u7528\u6307\u6807<\/td>\n<\/tr>\n<tr>\n<td>osx_exporter (\u793e\u533a)<\/td>\n<td>\u7535\u6c60\u3001\u6e29\u5ea6\u3001\u98ce\u6247\u8f6c\u901f\u3001\u7535\u6e90\u72b6\u6001\u3001pmset \u8bbe\u7f6e\u7b49 Mac \u4e13\u5c5e\u786c\u4ef6<\/td>\n<td>\u57fa\u4e8e IOKit \u548c macOS \u7cfb\u7edf\u547d\u4ee4&#xff0c;\u66b4\u9732 Mac \u7279\u6709\u7684\u5065\u5eb7\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>textfile \u6536\u96c6\u5668 &#043; \u81ea\u5b9a\u4e49\u811a\u672c<\/td>\n<td>\u4efb\u610f\u65e0\u6cd5\u88ab exporter \u76f4\u63a5\u91c7\u96c6\u7684\u6307\u6807&#xff08;\u5982 Time Machine \u5907\u4efd\u72b6\u6001\u3001\u5e94\u7528\u7248\u672c&#xff09;<\/td>\n<td>\u7075\u6d3b\u8865\u5145&#xff0c;\u914d\u5408 node_exporter \u7684 &#8211;collector.textfile.directory \u4f7f\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6700\u4f73\u7ec4\u5408&#xff1a;node_exporter \u8d1f\u8d23\u901a\u7528\u7cfb\u7edf\u6307\u6807&#xff0c;osx_exporter \u8d1f\u8d23 Mac \u786c\u4ef6\u6307\u6807&#xff0c;\u81ea\u5b9a\u4e49\u811a\u672c\u8d1f\u8d23\u4e1a\u52a1\u7279\u6709\u6570\u636e\u3002\u4e09\u8005\u4e0d\u51b2\u7a81&#xff0c;\u53ef\u5e76\u884c\u90e8\u7f72\u3002<\/p>\n<hr \/>\n<h4>2. \u90e8\u7f72 node_exporter (\u901a\u7528\u7cfb\u7edf\u6307\u6807)<\/h4>\n<p>node_exporter \u4e3a macOS \u63d0\u4f9b\u4e86\u9884\u7f16\u8bd1\u7684 amd64\/arm64 \u4e8c\u8fdb\u5236&#xff0c;\u5f00\u7bb1\u5373\u7528\u3002<\/p>\n<h5>2.1 \u4e0b\u8f7d\u4e0e\u5b89\u88c5<\/h5>\n<p><span class=\"token comment\"># \u786e\u5b9a\u82af\u7247\u67b6\u6784<\/span><br \/>\n<span class=\"token function\">uname<\/span> <span class=\"token parameter variable\">-m<\/span><br \/>\n<span class=\"token comment\"># x86_64 \u9009 amd64&#xff0c;arm64 \u9009 arm64<\/span><\/p>\n<p><span class=\"token comment\"># \u4e0b\u8f7d\u6700\u65b0\u7248&#xff08;\u4ee5 1.7.0 \u4e3a\u4f8b&#xff09;<\/span><br \/>\n<span class=\"token function\">wget<\/span> https:\/\/github.com\/prometheus\/node_exporter\/releases\/download\/v1.7.0\/node_exporter-1.7.0.darwin-arm64.tar.gz<br \/>\n<span class=\"token function\">tar<\/span> xzf node_exporter-1.7.0.darwin-arm64.tar.gz<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">cp<\/span> node_exporter-1.7.0.darwin-arm64\/node_exporter \/usr\/local\/bin\/<\/p>\n<h5>2.2 \u521b\u5efa LaunchDaemon \u5b9e\u73b0\u5f00\u673a\u81ea\u542f<\/h5>\n<p>macOS \u4f7f\u7528 launchd \u7ba1\u7406\u670d\u52a1&#xff0c;\u65e0\u9700\u624b\u52a8\u7f16\u5199 systemd \u6587\u4ef6\u3002\u521b\u5efa\u4e00\u4e2a plist \u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/Library\/LaunchDaemons\/io.prometheus.node_exporter.plist<\/p>\n<p>\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p><span class=\"token prolog\">&lt;?xml version&#061;&#034;1.0&#034; encoding&#061;&#034;UTF-8&#034;?&gt;<\/span><br \/>\n<span class=\"token doctype\"><span class=\"token punctuation\">&lt;!<\/span><span class=\"token doctype-tag\">DOCTYPE<\/span> <span class=\"token name\">plist<\/span> <span class=\"token name\">PUBLIC<\/span> <span class=\"token string\">&#034;-\/\/Apple\/\/DTD PLIST 1.0\/\/EN&#034;<\/span><br \/>\n <span class=\"token string\">&#034;http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd&#034;<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>plist<\/span> <span class=\"token attr-name\">version<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>1.0<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dict<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>Label<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>io.prometheus.node_exporter<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>ProgramArguments<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>array<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>\/usr\/local\/bin\/node_exporter<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>&#8211;collector.textfile.directory&#061;\/var\/lib\/node_exporter\/textfile<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n        <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>&#8211;web.listen-address&#061;:9100<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>array<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>RunAtLoad<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>true<\/span><span class=\"token punctuation\">\/&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>KeepAlive<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>true<\/span><span class=\"token punctuation\">\/&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>StandardOutPath<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>\/var\/log\/node_exporter.log<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>StandardErrorPath<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>key<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>\/var\/log\/node_exporter.err<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>string<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dict<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>plist<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>\u521b\u5efa textfile \u76ee\u5f55\u5e76\u8bbe\u7f6e\u6743\u9650&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/var\/lib\/node_exporter\/textfile<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">chmod<\/span> <span class=\"token number\">755<\/span> \/var\/lib\/node_exporter\/textfile<\/p>\n<p>\u52a0\u8f7d\u5e76\u542f\u52a8\u670d\u52a1&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> launchctl bootstrap system \/Library\/LaunchDaemons\/io.prometheus.node_exporter.plist<br \/>\n<span class=\"token function\">sudo<\/span> launchctl start io.prometheus.node_exporter<\/p>\n<p>\u9a8c\u8bc1&#xff1a;curl localhost:9100\/metrics&#xff0c;\u5e94\u8f93\u51fa\u4ee5 node_ \u5f00\u5934\u7684\u6307\u6807\u3002<\/p>\n<hr \/>\n<h4>3. \u90e8\u7f72 osx_exporter (Mac \u786c\u4ef6\u6307\u6807)<\/h4>\n<p>osx_exporter \u63d0\u4f9b\u7535\u6c60\u3001\u6e29\u5ea6\u3001\u98ce\u6247\u3001\u7535\u6e90\u7b49\u82f9\u679c\u7279\u5b9a\u6307\u6807\u3002<\/p>\n<h5>3.1 \u901a\u8fc7 Homebrew \u5b89\u88c5&#xff08;\u63a8\u8350&#xff09;<\/h5>\n<p>brew <span class=\"token function\">install<\/span> prometheus-community\/osx-exporter\/osx-exporter<br \/>\nbrew services start osx-exporter<\/p>\n<p>\u6216\u624b\u52a8\u4e0b\u8f7d\u4e8c\u8fdb\u5236\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">wget<\/span> https:\/\/github.com\/prometheus-community\/osx_exporter\/releases\/download\/v0.3.0\/osx_exporter-0.3.0.darwin-amd64.tar.gz<br \/>\n<span class=\"token function\">tar<\/span> xzf osx_exporter-0.3.0.darwin-amd64.tar.gz<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">cp<\/span> osx_exporter \/usr\/local\/bin\/<\/p>\n<p>\u521b\u5efa LaunchDaemon&#xff08;\u53c2\u8003 node_exporter&#xff09;&#xff0c;\u76d1\u542c\u7aef\u53e3\u9ed8\u8ba4 9101\u3002<\/p>\n<p>\u9a8c\u8bc1&#xff1a;curl localhost:9101\/metrics&#xff0c;\u5e94\u770b\u5230 osx_battery_charge_percent \u7b49\u3002<\/p>\n<hr \/>\n<h4>4. \u914d\u7f6e Prometheus \u6293\u53d6<\/h4>\n<p>\u5728 prometheus.yml \u4e2d\u6dfb\u52a0 macOS \u4e3b\u673a\u7684\u4e24\u4e2a Job&#xff1a;<\/p>\n<p><span class=\"token key atrule\">scrape_configs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token comment\"># \u901a\u7528 OS \u6307\u6807<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">job_name<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;macos-node&#039;<\/span><br \/>\n    <span class=\"token key atrule\">scrape_interval<\/span><span class=\"token punctuation\">:<\/span> 30s<br \/>\n    <span class=\"token key atrule\">static_configs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">targets<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#039;mac-mini.local:9100&#039;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">device<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;mac-mini&#039;<\/span><br \/>\n          <span class=\"token key atrule\">env<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;office&#039;<\/span><br \/>\n          <span class=\"token key atrule\">os<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;macos&#039;<\/span><\/p>\n<p>  <span class=\"token comment\"># \u82f9\u679c\u786c\u4ef6\u6307\u6807<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">job_name<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;macos-osx&#039;<\/span><br \/>\n    <span class=\"token key atrule\">scrape_interval<\/span><span class=\"token punctuation\">:<\/span> 30s<br \/>\n    <span class=\"token key atrule\">static_configs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">targets<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#039;mac-mini.local:9101&#039;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">device<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;mac-mini&#039;<\/span><\/p>\n<hr \/>\n<h4>5. \u6838\u5fc3\u76d1\u63a7\u6307\u6807\u4e0e PromQL<\/h4>\n<h5>5.1 node_exporter \u901a\u7528\u6307\u6807<\/h5>\n<table>\n<tr>\u6307\u6807\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>node_cpu_seconds_total{mode&#061;&#034;idle&#034;}<\/td>\n<td>CPU \u7a7a\u95f2\u65f6\u95f4&#xff08;\u7528\u4e8e\u8ba1\u7b97\u4f7f\u7528\u7387&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>node_memory_MemTotal_bytes \/ node_memory_MemAvailable_bytes<\/td>\n<td>\u5185\u5b58\u603b\u91cf \/ \u53ef\u7528\u91cf<\/td>\n<\/tr>\n<tr>\n<td>node_filesystem_avail_bytes{mountpoint&#061;&#034;\/&#034;}<\/td>\n<td>\u6839\u5206\u533a\u53ef\u7528\u5b57\u8282<\/td>\n<\/tr>\n<tr>\n<td>node_filesystem_size_bytes{mountpoint&#061;&#034;\/&#034;}<\/td>\n<td>\u6839\u5206\u533a\u603b\u5927\u5c0f<\/td>\n<\/tr>\n<tr>\n<td>node_network_receive_bytes_total{device&#061;&#034;en0&#034;}<\/td>\n<td>\u7f51\u7edc\u63a5\u6536\u5b57\u8282&#xff08;Wi-Fi \u901a\u5e38 en0&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>node_load1 \/ node_load5 \/ node_load15<\/td>\n<td>\u7cfb\u7edf\u8d1f\u8f7d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>PromQL \u793a\u4f8b&#xff1a;<\/p>\n<ul>\n<li>CPU \u4f7f\u7528\u7387&#xff1a;100 &#8211; (avg(rate(node_cpu_seconds_total{mode&#061;&#034;idle&#034;}[5m])) * 100)<\/li>\n<li>\u5185\u5b58\u4f7f\u7528\u7387&#xff1a;(1 &#8211; node_memory_MemAvailable_bytes \/ node_memory_MemTotal_bytes) * 100<\/li>\n<li>\u78c1\u76d8\u4f7f\u7528\u7387&#xff08;\u6839\u5206\u533a&#xff09;&#xff1a;(1 &#8211; node_filesystem_avail_bytes{mountpoint&#061;&#034;\/&#034;} \/ node_filesystem_size_bytes{mountpoint&#061;&#034;\/&#034;}) * 100<\/li>\n<\/ul>\n<h5>5.2 osx_exporter \u786c\u4ef6\u6307\u6807<\/h5>\n<table>\n<tr>\u6307\u6807\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>osx_battery_charge_percent<\/td>\n<td>\u5f53\u524d\u7535\u91cf\u767e\u5206\u6bd4<\/td>\n<\/tr>\n<tr>\n<td>osx_battery_cycle_count<\/td>\n<td>\u7535\u6c60\u5faa\u73af\u6b21\u6570<\/td>\n<\/tr>\n<tr>\n<td>osx_battery_health<\/td>\n<td>\u7535\u6c60\u5065\u5eb7\u72b6\u6001&#xff08;Good\/Fair\/Poor&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>osx_cpu_temperature_celsius<\/td>\n<td>CPU \u6e29\u5ea6&#xff08;\u6444\u6c0f\u5ea6&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>osx_fan_speed_rpm<\/td>\n<td>\u98ce\u6247\u8f6c\u901f&#xff08;RPM&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>osx_power_source<\/td>\n<td>\u7535\u6e90\u72b6\u6001&#xff08;AC\/Battery&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>osx_thermal_pressure<\/td>\n<td>\u6563\u70ed\u538b\u529b\u7b49\u7ea7&#xff08;Nominal\/Moderate\/Heavy&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>PromQL \u793a\u4f8b&#xff1a;<\/p>\n<ul>\n<li>\u7535\u6c60\u4f4e\u4e8e 20%&#xff1a;osx_battery_charge_percent &lt; 20<\/li>\n<li>CPU \u6e29\u5ea6\u8fc7\u9ad8&#xff1a;osx_cpu_temperature_celsius &gt; 80<\/li>\n<li>\u98ce\u6247\u5f02\u5e38\u4f4e\u901f&#xff1a;osx_fan_speed_rpm &lt; 1000&#xff08;\u53d6\u51b3\u4e8e\u673a\u578b&#xff09;<\/li>\n<\/ul>\n<hr \/>\n<h4>6. Grafana \u4eea\u8868\u76d8\u63a8\u8350<\/h4>\n<ul>\n<li>Node Exporter Full (ID: 1860)&#xff1a;\u901a\u7528\u7cfb\u7edf\u76d1\u63a7&#xff0c;CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u4e00\u5e94\u4ff1\u5168&#xff0c;\u76f4\u63a5\u9002\u914d macOS node_exporter \u6307\u6807\u3002<\/li>\n<li>macOS Hardware Monitor (ID: 14567 \u6216\u793e\u533a\u81ea\u5efa)&#xff1a;\u53ef\u4f7f\u7528 osx_exporter \u6570\u636e\u6e90\u521b\u5efa\u7535\u6c60\u4eea\u8868\u3001\u6e29\u5ea6\u8868\u76d8\u3002<\/li>\n<li>\u81ea\u5b9a\u4e49\u82f9\u679c\u8bbe\u5907\u76d1\u63a7\u5927\u5c4f&#xff1a;\u5c06\u7535\u91cf\u3001\u6e29\u5ea6\u3001\u8d1f\u8f7d\u7ec4\u5408\u5728\u540c\u4e00\u884c&#xff0c;\u9002\u5408 CI \u8282\u70b9\u770b\u677f\u3002<\/li>\n<\/ul>\n<p>\u5bfc\u5165\u540e\u9009\u62e9\u6570\u636e\u6e90&#xff0c;\u4f7f\u7528\u53d8\u91cf device \u533a\u5206\u4e0d\u540c Mac\u3002<\/p>\n<hr \/>\n<h4>7. \u544a\u8b66\u89c4\u5219\u5b9e\u6218<\/h4>\n<p><span class=\"token key atrule\">groups<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> macos_alerts<br \/>\n    <span class=\"token key atrule\">rules<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> MacOSHighCPU<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> 100 <span class=\"token punctuation\">&#8211;<\/span> (avg by(instance) (rate(node_cpu_seconds_total<span class=\"token punctuation\">{<\/span>mode&#061;&#034;idle&#034;<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">[<\/span>5m<span class=\"token punctuation\">]<\/span>)) * 100) <span class=\"token punctuation\">&gt;<\/span> 90<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 10m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<br \/>\n        <span class=\"token key atrule\">annotations<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">summary<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;Mac {{ $labels.instance }} CPU \u4f7f\u7528\u7387\u8d85\u8fc7 90%&#034;<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> MacOSLowDiskSpace<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> (1 <span class=\"token punctuation\">&#8211;<\/span> node_filesystem_avail_bytes<span class=\"token punctuation\">{<\/span>mountpoint&#061;&#034;\/&#034;<span class=\"token punctuation\">}<\/span> \/ node_filesystem_size_bytes<span class=\"token punctuation\">{<\/span>mountpoint&#061;&#034;\/&#034;<span class=\"token punctuation\">}<\/span>) * 100 <span class=\"token punctuation\">&gt;<\/span> 85<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 5m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> critical<br \/>\n        <span class=\"token key atrule\">annotations<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">summary<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;Mac \u6839\u5206\u533a\u4f7f\u7528\u7387\u8d85\u8fc7 85%&#034;<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> MacOSBatteryLow<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> osx_battery_charge_percent &lt; 20<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 2m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<br \/>\n        <span class=\"token key atrule\">annotations<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">summary<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;Mac {{ $labels.instance }} \u7535\u91cf\u4f4e\u4e8e 20%&#xff0c;\u8bf7\u5145\u7535&#034;<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> MacOSHighTemperature<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> osx_cpu_temperature_celsius <span class=\"token punctuation\">&gt;<\/span> 80<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 5m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<br \/>\n        <span class=\"token key atrule\">annotations<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">summary<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;Mac CPU \u6e29\u5ea6\u8d85\u8fc7 80\u2103&#xff0c;\u5f53\u524d {{ $value }}\u2103&#034;<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> MacOSBatteryHealthDegraded<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> osx_battery_health <span class=\"token tag\">!&#061;<\/span> 0   <span class=\"token comment\"># \u5047\u8bbe0&#061;Good, 1&#061;Fair, 2&#061;Poor<\/span><br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> info<br \/>\n        <span class=\"token key atrule\">annotations<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">summary<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;Mac \u7535\u6c60\u5065\u5eb7\u5ea6\u4e0b\u964d&#xff0c;\u5efa\u8bae\u68c0\u67e5&#034;<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> MacOSNoMetric<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> up<span class=\"token punctuation\">{<\/span>job&#061;&#034;macos<span class=\"token punctuation\">&#8211;<\/span>node&#034;<span class=\"token punctuation\">}<\/span> &#061;&#061; 0<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 2m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> critical<br \/>\n        <span class=\"token key atrule\">annotations<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">summary<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;Mac \u8bbe\u5907 {{ $labels.instance }} \u6307\u6807\u4e0d\u53ef\u8fbe&#034;<\/span><\/p>\n<p>\u53ef\u6839\u636e\u5b9e\u9645\u7535\u6c60\u5065\u5eb7\u6307\u6807\u683c\u5f0f\u5fae\u8c03\u3002<\/p>\n<hr \/>\n<h4>8. \u8fdb\u9636&#xff1a;\u81ea\u5b9a\u4e49 Textfile \u6307\u6807\u4e0e\u81ea\u52a8\u5316<\/h4>\n<h5>8.1 \u5229\u7528 textfile \u6536\u96c6\u5668\u76d1\u63a7 Time Machine \u72b6\u6001<\/h5>\n<p>\u7f16\u5199\u811a\u672c \/usr\/local\/bin\/time-machine-metrics.sh&#xff1a;<\/p>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><br \/>\n<span class=\"token assign-left variable\">OUTPUT<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/var\/lib\/node_exporter\/textfile\/tm.prom&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">LAST_BACKUP<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span>tmutil latestbackup <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null<span class=\"token variable\">)<\/span><\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$LAST_BACKUP<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    <span class=\"token assign-left variable\">SEC<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">date<\/span> <span class=\"token parameter variable\">-j<\/span> <span class=\"token parameter variable\">-f<\/span> <span class=\"token string\">&#034;%Y-%m-%d-%H%M%S&#034;<\/span> <span class=\"token string\">&#034;<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">basename<\/span> $LAST_BACKUP<span class=\"token variable\">)<\/span><\/span>&#034;<\/span> <span class=\"token string\">&#034;&#043;%s&#034;<\/span> <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null <span class=\"token operator\">||<\/span> <span class=\"token builtin class-name\">echo<\/span> <span class=\"token number\">0<\/span><span class=\"token variable\">)<\/span><\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;time_machine_last_backup_timestamp <span class=\"token variable\">$SEC<\/span>&#034;<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token variable\">$OUTPUT<\/span>.tmp<br \/>\n<span class=\"token keyword\">else<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;time_machine_last_backup_timestamp 0&#034;<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token variable\">$OUTPUT<\/span>.tmp<br \/>\n<span class=\"token keyword\">fi<\/span><br \/>\n<span class=\"token function\">mv<\/span> <span class=\"token variable\">$OUTPUT<\/span>.tmp <span class=\"token variable\">$OUTPUT<\/span><\/p>\n<p>\u8bbe\u7f6e cron \u6216 launchd \u6bcf\u5206\u949f\u6267\u884c&#xff0c;\u5373\u53ef\u83b7\u5f97 time_machine_last_backup_timestamp \u6307\u6807\u3002<\/p>\n<h5>8.2 \u76d1\u63a7 Xcode \u7248\u672c\u6216\u6784\u5efa\u72b6\u6001<\/h5>\n<p>\u540c\u6837\u7f16\u5199\u811a\u672c&#xff0c;\u901a\u8fc7 xcodebuild -version \u5c06\u7248\u672c\u4fe1\u606f\u8f93\u51fa\u4e3a gauge&#xff0c;\u6216\u8bfb\u53d6 CI \u65e5\u5fd7\u7edf\u8ba1\u6210\u529f\/\u5931\u8d25\u6b21\u6570\u3002<\/p>\n<h5>8.3 \u6027\u80fd\u4e0e\u5b89\u5168<\/h5>\n<ul>\n<li>node_exporter \u548c osx_exporter \u5747\u6d88\u8017\u6781\u4f4e\u8d44\u6e90&#xff0c;\u6293\u53d6\u95f4\u9694 30s \u5b8c\u5168\u65e0\u611f\u3002<\/li>\n<li>\u76d1\u542c\u7aef\u53e3\u7ed1\u5b9a 127.0.0.1 \u4ee5\u589e\u5f3a\u5b89\u5168&#xff08;\u4fee\u6539 &#8211;web.listen-address&#xff09;\u3002<\/li>\n<li>\u82e5\u9700\u8fdc\u7a0b\u6293\u53d6&#xff0c;\u4f7f\u7528\u9632\u706b\u5899\u6216 SSH \u96a7\u9053&#xff0c;\u907f\u514d\u516c\u7f51\u66b4\u9732\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>9. \u603b\u7ed3<\/h4>\n<p>macOS \u4e0d\u518d\u662f\u76d1\u63a7\u89c6\u91ce\u4e2d\u7684\u76f2\u533a\u3002\u901a\u8fc7 node_exporter \u4e0e osx_exporter \u7684\u7ec4\u5408&#xff0c;\u4f60\u80fd\u591f\u7528 Prometheus \u5b8c\u6574\u6355\u6349 Mac \u7684 CPU \u8d1f\u8f7d\u3001\u5185\u5b58\u538b\u529b\u3001\u78c1\u76d8\u5360\u7528\u3001\u7f51\u7edc\u6d41\u91cf\u4ee5\u53ca\u7535\u6c60\u3001\u6e29\u5ea6\u3001\u98ce\u6247\u7b49\u4e13\u5c5e\u786c\u4ef6\u4fe1\u53f7\u3002Grafana \u5927\u5c4f\u4e0a&#xff0c;\u6bcf\u4e00\u4e2a\u6784\u5efa\u8282\u70b9\u3001\u6bcf\u4e00\u53f0\u5f00\u53d1\u8005\u5de5\u4f5c\u7ad9\u90fd\u53d8\u5f97\u900f\u660e&#xff1b;\u5f53 CPU \u8fc7\u70ed\u3001\u78c1\u76d8\u544a\u6025\u6216\u7535\u91cf\u4e0d\u8db3\u65f6&#xff0c;Alertmanager \u7684\u544a\u8b66\u5c06\u53ca\u65f6\u89e6\u8fbe\u3002\u4ece\u6b64&#xff0c;\u82f9\u679c\u8bbe\u5907\u4e5f\u878d\u5165\u7edf\u4e00\u7684 Prometheus \u53ef\u89c2\u6d4b\u4f53\u7cfb&#xff0c;\u4e3a DevOps \u6d41\u6c34\u7ebf\u548c\u6df7\u5408\u529e\u516c\u4fdd\u9a7e\u62a4\u822a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218&#xff1a;\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027\u5728\u6df7\u5408\u529e\u516c\u4e0e DevOps \u6d41\u6c34\u7ebf\u4e2d&#xff0c;macOS \u8bbe\u5907\u6b63\u627f\u62c5\u7740\u8d8a\u6765\u8d8a\u591a\u7684\u5173\u952e\u89d2\u8272&#xff1a;iOS \u6784\u5efa\u8282\u70b9\u3001\u5f00\u53d1\u8005\u5de5\u4f5c\u7ad9\u3001\u6301\u7eed\u96c6\u6210 runner\u3002\u4e00\u65e6\u5b83\u7684 CPU \u8d1f\u8f7d\u98d9\u5347\u3001\u5185\u5b58\u538b\u529b\u6fd2\u4e34\u7ea2\u8272\u3001\u78c1\u76d8\u7a7a\u95f4\u67af\u7aed\u3001\u7535\u6c60\u5065\u5eb7\u4e0b\u964d\u6216\u6e29\u5ea6\u5f02\u5e38&#xff0c;\u8f7b\u5219\u62d6\u6162\u5f00\u53d1\u8fdb\u5ea6&#xff0c;\u91cd\u5219\u963b\u585e\u6574\u4e2a\u53d1\u5e03\u6d41\u6c34\u7ebf\u3002Prometheus \u901a\u8fc7\u5b98\u65b9 node_exporter<\/p>\n","protected":false},"author":2,"featured_media":100786,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[330,678],"topic":[],"class_list":["post-100787","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-macos","tag-prometheus"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/100787.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218&#xff1a;\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027\u5728\u6df7\u5408\u529e\u516c\u4e0e DevOps \u6d41\u6c34\u7ebf\u4e2d&#xff0c;macOS \u8bbe\u5907\u6b63\u627f\u62c5\u7740\u8d8a\u6765\u8d8a\u591a\u7684\u5173\u952e\u89d2\u8272&#xff1a;iOS \u6784\u5efa\u8282\u70b9\u3001\u5f00\u53d1\u8005\u5de5\u4f5c\u7ad9\u3001\u6301\u7eed\u96c6\u6210 runner\u3002\u4e00\u65e6\u5b83\u7684 CPU \u8d1f\u8f7d\u98d9\u5347\u3001\u5185\u5b58\u538b\u529b\u6fd2\u4e34\u7ea2\u8272\u3001\u78c1\u76d8\u7a7a\u95f4\u67af\u7aed\u3001\u7535\u6c60\u5065\u5eb7\u4e0b\u964d\u6216\u6e29\u5ea6\u5f02\u5e38&#xff0c;\u8f7b\u5219\u62d6\u6162\u5f00\u53d1\u8fdb\u5ea6&#xff0c;\u91cd\u5219\u963b\u585e\u6574\u4e2a\u53d1\u5e03\u6d41\u6c34\u7ebf\u3002Prometheus \u901a\u8fc7\u5b98\u65b9 node_exporter\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/100787.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-05T02:17:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260905021721-6a9b7bb1b4841.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/100787.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/100787.html\",\"name\":\"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-05T02:17:28+00:00\",\"dateModified\":\"2026-09-05T02:17:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/100787.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/100787.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/100787.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/100787.html","og_locale":"zh_CN","og_type":"article","og_title":"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218&#xff1a;\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027\u5728\u6df7\u5408\u529e\u516c\u4e0e DevOps \u6d41\u6c34\u7ebf\u4e2d&#xff0c;macOS \u8bbe\u5907\u6b63\u627f\u62c5\u7740\u8d8a\u6765\u8d8a\u591a\u7684\u5173\u952e\u89d2\u8272&#xff1a;iOS \u6784\u5efa\u8282\u70b9\u3001\u5f00\u53d1\u8005\u5de5\u4f5c\u7ad9\u3001\u6301\u7eed\u96c6\u6210 runner\u3002\u4e00\u65e6\u5b83\u7684 CPU \u8d1f\u8f7d\u98d9\u5347\u3001\u5185\u5b58\u538b\u529b\u6fd2\u4e34\u7ea2\u8272\u3001\u78c1\u76d8\u7a7a\u95f4\u67af\u7aed\u3001\u7535\u6c60\u5065\u5eb7\u4e0b\u964d\u6216\u6e29\u5ea6\u5f02\u5e38&#xff0c;\u8f7b\u5219\u62d6\u6162\u5f00\u53d1\u8fdb\u5ea6&#xff0c;\u91cd\u5219\u963b\u585e\u6574\u4e2a\u53d1\u5e03\u6d41\u6c34\u7ebf\u3002Prometheus \u901a\u8fc7\u5b98\u65b9 node_exporter","og_url":"https:\/\/www.wsisp.com\/helps\/100787.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-05T02:17:28+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260905021721-6a9b7bb1b4841.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/100787.html","url":"https:\/\/www.wsisp.com\/helps\/100787.html","name":"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-05T02:17:28+00:00","dateModified":"2026-09-05T02:17:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/100787.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/100787.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/100787.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Prometheus \u76d1\u63a7 macOS \u5168\u6808\u5b9e\u6218\uff1a\u4ece\u786c\u4ef6\u6e29\u5ea6\u5230\u7cfb\u7edf\u8d1f\u8f7d\u7684\u82f9\u679c\u8bbe\u5907\u53ef\u89c2\u6d4b\u6027"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/100787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=100787"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/100787\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/100786"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=100787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=100787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=100787"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=100787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}