{"id":33008,"date":"2026-09-03T10:00:00","date_gmt":"2026-09-03T02:00:00","guid":{"rendered":"https:\/\/cn.hostease.com\/blog\/?p=33008"},"modified":"2026-09-09T09:26:35","modified_gmt":"2026-09-09T01:26:35","slug":"prometheus-server-practical","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/blog\/guides\/prometheus-server-practical\/","title":{"rendered":"Prometheus \u6307\u6807\u544a\u8b66\u89c4\u5219\u914d\u7f6e\uff1a\u670d\u52a1\u5668\u9884\u8b66\u5b9e\u6218"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/prometheus-server-practical-cover.webp\" alt=\"Prometheus \u670d\u52a1\u5668\u76d1\u63a7\u544a\u8b66\u5c01\u9762\u56fe\uff0c\u5c55\u793a\u670d\u52a1\u5668\u673a\u67b6\u4e0e\u72b6\u6001\u4eea\u8868\" loading=\"lazy\" \/><\/p>\n<h2>\u4e3a\u4ec0\u4e48\u9700\u8981\u4e3a<a href=\"https:\/\/cn.hostease.com\/blog\/server\/\">\u670d\u52a1\u5668\u914d\u7f6e<\/a> Prometheus \u6307\u6807\u544a\u8b66\u89c4\u5219<\/h2>\n<p>\u670d\u52a1\u5668\u4e00\u65e6\u51fa\u73b0 CPU \u6ee1\u8f7d\u3001\u5185\u5b58\u8017\u5c3d\u6216\u78c1\u76d8\u5199\u6ee1\uff0c\u5f80\u5f80\u4e0d\u662f\u77ac\u95f4\u53d1\u751f\u7684\uff0c\u800c\u662f\u6709\u4e00\u4e2a\u9010\u6e10\u6076\u5316\u7684\u8fc7\u7a0b\u3002\u5982\u679c\u7b49\u5230\u7528\u6237\u53cd\u9988\u7f51\u7ad9\u6253\u4e0d\u5f00\u624d\u53bb\u5904\u7406\uff0c\u635f\u5931\u5df2\u7ecf\u9020\u6210\u3002Prometheus \u4f5c\u4e3a\u4e00\u5957\u5f00\u6e90\u76d1\u63a7\u7cfb\u7edf\uff0c\u80fd\u591f\u6301\u7eed\u91c7\u96c6\u670d\u52a1\u5668\u5404\u9879\u6307\u6807\uff0c\u5e76\u901a\u8fc7\u544a\u8b66\u89c4\u5219\u5728\u95ee\u9898\u6076\u5316\u524d\u4e3b\u52a8\u901a\u77e5\u8fd0\u7ef4\u4eba\u5458\u3002\u8fd9\u7bc7\u6587\u7ae0\u4f1a\u6559\u4f60\u5982\u4f55\u914d\u7f6e\u4e00\u5957\u5b9e\u7528\u7684 Prometheus \u6307\u6807\u544a\u8b66\u89c4\u5219\uff0c\u8ba9\u670d\u52a1\u5668\u5728\u771f\u6b63\u5b95\u673a\u4e4b\u524d\u5c31\u53d1\u51fa\u9884\u8b66\u3002<\/p>\n<p>\u5f88\u591a\u7ad9\u957f\u628a\u76d1\u63a7\u505c\u7559\u5728&#8221;\u80fd\u770b\u56fe\u8868&#8221;\u7684\u5c42\u9762\uff0c\u5374\u5ffd\u7565\u4e86\u544a\u8b66\u624d\u662f\u76d1\u63a7\u7684\u6838\u5fc3\u4ef7\u503c\u3002\u56fe\u8868\u53ea\u80fd\u8ba9\u4f60\u4e8b\u540e\u590d\u76d8\uff0c\u544a\u8b66\u624d\u80fd\u8ba9\u4f60\u63d0\u524d\u4ecb\u5165\u3002\u6211\u4eec\u5efa\u8bae\u7684\u505a\u6cd5\u662f\uff1a\u5148\u660e\u786e\u54ea\u4e9b\u6307\u6807\u6700\u503c\u5f97\u5173\u6ce8\uff0c\u518d\u4e3a\u5b83\u4eec\u7f16\u5199\u544a\u8b66\u89c4\u5219\uff0c\u6700\u540e\u901a\u8fc7 Alertmanager \u628a\u901a\u77e5\u9001\u5230\u4f60\u7684\u90ae\u7bb1\u6216\u5373\u65f6\u901a\u8baf\u5de5\u5177\u3002\u4e0b\u9762\u6211\u4eec\u6309\u8fd9\u4e2a\u601d\u8def\u4e00\u6b65\u6b65\u5c55\u5f00\u3002\u5982\u679c\u4f60\u521a\u5f00\u59cb\u63a5\u89e6\u670d\u52a1\u5668\u8fd0\u7ef4\uff0c\u53ef\u4ee5\u5148\u9605\u8bfb\u6211\u4eec\u5173\u4e8e<a href=\"https:\/\/cn.hostease.com\/blog\/server\/\">\u670d\u52a1\u5668\u914d\u7f6e\u4e0e\u6027\u80fd<\/a>\u7684\u7cfb\u5217\u6587\u7ae0\uff0c\u5efa\u7acb\u57fa\u7840\u8ba4\u77e5\u3002<\/p>\n<h2>\u544a\u8b66\u89c4\u5219\u7684\u57fa\u672c\u7ed3\u6784\u4e0e\u89e6\u53d1\u903b\u8f91<\/h2>\n<p>Prometheus \u7684\u544a\u8b66\u89c4\u5219\u5199\u5728\u72ec\u7acb\u7684\u89c4\u5219\u6587\u4ef6\u4e2d\uff0c\u901a\u8fc7 <code>rule_files<\/code> \u5b57\u6bb5\u52a0\u8f7d\u5230 Prometheus \u914d\u7f6e\u91cc\u3002\u4e00\u6761\u89c4\u5219\u7531 <code>expr<\/code>\uff08\u8868\u8fbe\u5f0f\uff09\u3001<code>for<\/code>\uff08\u6301\u7eed\u65f6\u95f4\uff09\u548c <code>labels<\/code>\/<code>annotations<\/code>\uff08\u6807\u7b7e\u4e0e\u6ce8\u89e3\uff09\u7ec4\u6210\u3002<code>expr<\/code> \u7528 PromQL \u67e5\u8be2\u8bed\u8a00\u63cf\u8ff0&#8221;\u4ec0\u4e48\u60c5\u51b5\u4e0b\u7b97\u5f02\u5e38&#8221;\uff0c<code>for<\/code> \u8868\u793a\u8be5\u5f02\u5e38\u9700\u8981\u6301\u7eed\u591a\u4e45\u624d\u771f\u6b63\u89e6\u53d1\u544a\u8b66\uff0c<code>annotations<\/code> \u5219\u7528\u6765\u586b\u5199\u544a\u8b66\u6807\u9898\u548c\u8be6\u7ec6\u63cf\u8ff0\u3002<\/p>\n<p>\u4e00\u4e2a\u5178\u578b\u7684\u89c4\u5219\u6587\u4ef6\u7247\u6bb5\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-yaml\">groups:\n  - name: server-alerts\n    rules:\n      - alert: HighCPUUsage\n        expr: 100 - (avg by (instance) (rate(node_cpu_seconds_total{mode=&quot;idle&quot;}[5m])) * 100) &gt; 85\n        for: 5m\n        labels:\n          severity: warning\n        annotations:\n          summary: &quot;{{ $labels.instance }} CPU \u4f7f\u7528\u7387\u8fc7\u9ad8&quot;\n          description: &quot;\u670d\u52a1\u5668 CPU \u4f7f\u7528\u7387\u5df2\u6301\u7eed\u8d85\u8fc7 85%\uff0c\u8bf7\u68c0\u67e5\u662f\u5426\u6709\u5f02\u5e38\u8fdb\u7a0b\u3002&quot;\n<\/code><\/pre>\n<p>\u8fd9\u91cc <code>for: 5m<\/code> \u7684\u4f5c\u7528\u5f88\u5173\u952e\u3002\u5b83\u8981\u6c42 CPU \u4f7f\u7528\u7387\u8fde\u7eed 5 \u5206\u949f\u90fd\u8d85\u8fc7 85% \u624d\u89e6\u53d1\u544a\u8b66\uff0c\u53ef\u4ee5\u907f\u514d\u77ac\u65f6\u5cf0\u503c\u9020\u6210\u7684\u8bef\u62a5\u3002\u6bd4\u5982\u7f51\u7ad9\u505a\u4fc3\u9500\u6d3b\u52a8\u65f6 CPU \u77ed\u6682\u51b2\u5230 90%\uff0c\u53ea\u8981\u5f88\u5feb\u56de\u843d\uff0c\u5c31\u4e0d\u4f1a\u6253\u6270\u4f60\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/prometheus-server-practical-alert-flow.webp\" alt=\"Prometheus \u544a\u8b66\u6d41\u7a0b\u793a\u610f\u56fe\uff0c\u5c55\u793a\u4ece\u670d\u52a1\u5668\u91c7\u96c6\u5230\u901a\u77e5\u7684\u4e09\u4e2a\u9636\u6bb5\" loading=\"lazy\" \/><\/p>\n<h2>\u5173\u952e\u6307\u6807\u4e0e\u544a\u8b66\u9608\u503c\u8bbe\u8ba1<\/h2>\n<p>\u670d\u52a1\u5668\u76d1\u63a7\u6700\u503c\u5f97\u5173\u6ce8\u7684\u6307\u6807\u96c6\u4e2d\u5728 CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u548c\u8d1f\u8f7d\u4e94\u4e2a\u65b9\u9762\u3002\u4e0b\u9762\u6211\u4eec\u7ed9\u51fa\u6bcf\u4e2a\u6307\u6807\u7684\u544a\u8b66\u8868\u8fbe\u5f0f\u548c\u63a8\u8350\u9608\u503c\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u670d\u52a1\u5668\u7684\u5b9e\u9645\u89c4\u683c\u8c03\u6574\u3002<\/p>\n<h3>CPU \u4f7f\u7528\u7387\u544a\u8b66<\/h3>\n<p>CPU \u662f\u670d\u52a1\u5668\u6700\u6838\u5fc3\u7684\u8d44\u6e90\u3002\u5f53 CPU \u957f\u671f\u6ee1\u8f7d\uff0c\u7f51\u7ad9\u54cd\u5e94\u4f1a\u660e\u663e\u53d8\u6162\u3002\u9664\u4e86\u6574\u4f53\u4f7f\u7528\u7387\uff0c\u8fd8\u8981\u5173\u6ce8\u5355\u6838\u662f\u5426\u88ab\u6253\u6ee1\uff0c\u56e0\u4e3a\u5355\u6838\u74f6\u9888\u540c\u6837\u4f1a\u62d6\u6162\u670d\u52a1\u3002<\/p>\n<pre><code class=\"language-yaml\">- alert: HighCPUUsage\n  expr: 100 - (avg by (instance) (rate(node_cpu_seconds_total{mode=&quot;idle&quot;}[5m])) * 100) &gt; 85\n  for: 5m\n  labels:\n    severity: warning\n  annotations:\n    summary: &quot;{{ $labels.instance }} CPU \u4f7f\u7528\u7387\u8fc7\u9ad8&quot;\n    description: &quot;CPU \u4f7f\u7528\u7387\u8d85\u8fc7 85% \u5df2\u6301\u7eed 5 \u5206\u949f\u3002&quot;\n<\/code><\/pre>\n<h3>\u5185\u5b58\u4f7f\u7528\u7387\u544a\u8b66<\/h3>\n<p>\u5185\u5b58\u4e0d\u8db3\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u5f00\u59cb\u4f7f\u7528\u4ea4\u6362\u5206\u533a\uff08swap\uff09\uff0c\u78c1\u76d8 I\/O \u6025\u5267\u4e0a\u5347\uff0c\u7f51\u7ad9\u901f\u5ea6\u65ad\u5d16\u5f0f\u4e0b\u8dcc\u3002\u5185\u5b58\u544a\u8b66\u5efa\u8bae\u5206\u4e24\u7ea7\uff1a\u4f7f\u7528\u7387\u8d85\u8fc7 85% \u5148\u8b66\u544a\uff0c\u8d85\u8fc7 95% \u518d\u5347\u7ea7\u4e3a\u4e25\u91cd\u3002\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u5171\u4eab\u8d44\u6e90\u53d7\u9650\u7684<a href=\"https:\/\/cn.hostease.com\/web-hosting\/\">\u865a\u62df\u4e3b\u673a<\/a>\uff0c\u5185\u5b58\u544a\u8b66\u5c24\u5176\u91cd\u8981\uff0c\u53ef\u4ee5\u53c2\u8003\u6211\u4eec\u5173\u4e8e<a href=\"https:\/\/cn.hostease.com\/vps\/\">\u865a\u62df\u4e3b\u673a\u4e0e VPS \u7684\u533a\u522b<\/a>\u6765\u7406\u89e3\u4e0d\u540c\u65b9\u6848\u7684\u5185\u5b58\u9694\u79bb\u5dee\u5f02\u3002<\/p>\n<pre><code class=\"language-yaml\">- alert: HighMemoryUsage\n  expr: (1 - (node_memory_MemAvailable_bytes \/ node_memory_MemTotal_bytes)) * 100 &gt; 85\n  for: 5m\n  labels:\n    severity: warning\n  annotations:\n    summary: &quot;{{ $labels.instance }} \u5185\u5b58\u4f7f\u7528\u7387\u8fc7\u9ad8&quot;\n    description: &quot;\u5185\u5b58\u4f7f\u7528\u7387\u8d85\u8fc7 85%\uff0c\u7cfb\u7edf\u53ef\u80fd\u5f00\u59cb\u4f7f\u7528 swap\u3002&quot;\n<\/code><\/pre>\n<h3>\u78c1\u76d8\u7a7a\u95f4\u544a\u8b66<\/h3>\n<p>\u78c1\u76d8\u5199\u6ee1\u662f\u5bfc\u81f4\u670d\u52a1\u4e0d\u53ef\u7528\u7684\u5e38\u89c1\u539f\u56e0\uff0c\u5c24\u5176\u662f\u65e5\u5fd7\u6587\u4ef6\u3001\u6570\u636e\u5e93\u548c\u5907\u4efd\u76ee\u5f55\u3002\u78c1\u76d8\u544a\u8b66\u8981\u6309\u6302\u8f7d\u70b9\u5206\u522b\u5224\u65ad\uff0c\u56e0\u4e3a\u6839\u5206\u533a\u548c\u6570\u636e\u5206\u533a\u7684\u60c5\u51b5\u53ef\u80fd\u5b8c\u5168\u4e0d\u540c\u3002<\/p>\n<pre><code class=\"language-yaml\">- alert: DiskSpaceLow\n  expr: (1 - (node_filesystem_avail_bytes{mountpoint=&quot;\/&quot;} \/ node_filesystem_size_bytes{mountpoint=&quot;\/&quot;})) * 100 &gt; 90\n  for: 5m\n  labels:\n    severity: critical\n  annotations:\n    summary: &quot;{{ $labels.instance }} \u6839\u5206\u533a\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3&quot;\n    description: &quot;\u6839\u5206\u533a\u4f7f\u7528\u7387\u8d85\u8fc7 90%\uff0c\u8bf7\u53ca\u65f6\u6e05\u7406\u6216\u6269\u5bb9\u3002&quot;\n<\/code><\/pre>\n<h3>\u7f51\u7edc\u4e0e\u8d1f\u8f7d\u544a\u8b66<\/h3>\n<p>\u7f51\u7edc\u6d41\u91cf\u5f02\u5e38\u548c\u7cfb\u7edf\u8d1f\u8f7d\u8fc7\u9ad8\u540c\u6837\u9700\u8981\u5173\u6ce8\u3002\u8d1f\u8f7d\uff08load average\uff09\u53cd\u6620\u7cfb\u7edf\u6574\u4f53\u7e41\u5fd9\u7a0b\u5ea6\uff0c\u901a\u5e38\u5efa\u8bae\u4ee5 CPU \u6838\u5fc3\u6570\u4e3a\u57fa\u51c6\uff0c\u8d1f\u8f7d\u6301\u7eed\u8d85\u8fc7\u6838\u5fc3\u6570\u5c31\u8bf4\u660e\u7cfb\u7edf\u8fc7\u8f7d\u3002<\/p>\n<pre><code class=\"language-yaml\">- alert: HighSystemLoad\n  expr: node_load1 &gt; (count by (instance) (node_cpu_seconds_total{mode=&quot;system&quot;})) * 2\n  for: 10m\n  labels:\n    severity: warning\n  annotations:\n    summary: &quot;{{ $labels.instance }} \u7cfb\u7edf\u8d1f\u8f7d\u8fc7\u9ad8&quot;\n    description: &quot;1 \u5206\u949f\u5e73\u5747\u8d1f\u8f7d\u8d85\u8fc7 CPU \u6838\u5fc3\u6570\u7684 2 \u500d\uff0c\u7cfb\u7edf\u53ef\u80fd\u8fc7\u8f7d\u3002&quot;\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/prometheus-server-practical-threshold-comparison.webp\" alt=\"Prometheus \u544a\u8b66\u9608\u503c\u5bf9\u6bd4\u56fe\uff0c\u5065\u5eb7\u72b6\u6001\u4e0e\u8fc7\u8f7d\u72b6\u6001\u5bf9\u6bd4\" loading=\"lazy\" \/><\/p>\n<h2>\u901a\u8fc7 Alertmanager \u628a\u544a\u8b66\u9001\u5230\u4f60\u7684\u624b\u4e0a<\/h2>\n<p>\u89c4\u5219\u89e6\u53d1\u540e\uff0cPrometheus \u4f1a\u628a\u544a\u8b66\u63a8\u9001\u7ed9 Alertmanager\uff0c\u7531\u5b83\u8d1f\u8d23\u53bb\u91cd\u3001\u5206\u7ec4\u5e76\u53d1\u9001\u901a\u77e5\u3002Alertmanager \u652f\u6301\u90ae\u4ef6\u3001Webhook\u3001\u4f01\u4e1a\u5fae\u4fe1\u3001\u9489\u9489\u7b49\u591a\u79cd\u6e20\u9053\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u628a\u544a\u8b66\u53d1\u9001\u5230\u90ae\u7bb1\u7684\u6700\u5c0f\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-yaml\">route:\n  group_by: ['alertname']\n  group_wait: 30s\n  group_interval: 5m\n  repeat_interval: 4h\n  receiver: 'email'\n\nreceivers:\n  - name: 'email'\n    email_configs:\n      - to: 'ops@example.com'\n        from: 'alert@example.com'\n        smarthost: 'smtp.example.com:587'\n        auth_username: 'alert@example.com'\n        auth_password: 'your-password'\n<\/code><\/pre>\n<p><code>repeat_interval: 4h<\/code> \u8868\u793a\u540c\u4e00\u544a\u8b66\u5728 4 \u5c0f\u65f6\u5185\u4e0d\u4f1a\u91cd\u590d\u53d1\u9001\uff0c\u907f\u514d\u544a\u8b66\u5237\u5c4f\u3002\u5982\u679c\u4f60\u5e0c\u671b\u544a\u8b66\u76f4\u63a5\u63a8\u9001\u5230\u624b\u673a\uff0c\u53ef\u4ee5\u63a5\u5165\u4f01\u4e1a\u5fae\u4fe1\u6216\u9489\u9489\u7684 Webhook\uff0c\u914d\u7f6e\u65b9\u5f0f\u7c7b\u4f3c\uff0c\u53ea\u662f\u628a <code>email_configs<\/code> \u6362\u6210\u5bf9\u5e94\u7684 <code>webhook_configs<\/code>\u3002\u544a\u8b66\u901a\u77e5\u7684\u53ca\u65f6\u6027\u4e5f\u53d6\u51b3\u4e8e\u670d\u52a1\u5668\u672c\u8eab\u7684\u7a33\u5b9a\u6027\uff0c\u9009\u62e9\u53ef\u9760\u7684<a href=\"https:\/\/cn.hostease.com\/dedicated-server\/\">\u72ec\u7acb\u670d\u52a1\u5668<\/a>\u65b9\u6848\u53ef\u4ee5\u51cf\u5c11\u56e0\u5bbf\u4e3b\u673a\u6545\u969c\u5bfc\u81f4\u7684\u76d1\u63a7\u4e2d\u65ad\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/prometheus-server-practical-alertmanager-notify.webp\" alt=\"Alertmanager \u544a\u8b66\u901a\u77e5\u793a\u610f\u56fe\uff0c\u624b\u673a\u6536\u5230\u670d\u52a1\u5668\u9884\u8b66\u901a\u77e5\" loading=\"lazy\" \/><\/p>\n<h2>\u544a\u8b66\u89c4\u5219\u4e0a\u7ebf\u524d\u7684\u9a8c\u8bc1\u4e0e\u6392\u969c<\/h2>\n<p>\u89c4\u5219\u5199\u597d\u540e\uff0c\u4e0d\u8981\u76f4\u63a5\u4e0a\u7ebf\uff0c\u5148\u7528 Prometheus \u81ea\u5e26\u7684\u5de5\u5177\u505a\u6821\u9a8c\u3002<code>promtool<\/code> \u662f\u5b98\u65b9\u63d0\u4f9b\u7684\u89c4\u5219\u68c0\u67e5\u5de5\u5177\uff0c\u53ef\u4ee5\u5feb\u901f\u53d1\u73b0\u8bed\u6cd5\u9519\u8bef\uff1a<\/p>\n<pre><code class=\"language-bash\">promtool check rules \/etc\/prometheus\/rules\/server-alerts.yml\n<\/code><\/pre>\n<p>\u5982\u679c\u8f93\u51fa <code>SUCCESS<\/code>\uff0c\u8bf4\u660e\u89c4\u5219\u8bed\u6cd5\u6ca1\u6709\u95ee\u9898\u3002\u63a5\u7740\u91cd\u542f Prometheus \u52a0\u8f7d\u65b0\u89c4\u5219\uff0c\u7136\u540e\u5728 Prometheus \u7684 Web \u754c\u9762\u8fdb\u5165&#8221;Alerts&#8221;\u9875\u9762\uff0c\u786e\u8ba4\u89c4\u5219\u72b6\u6001\u4e3a <code>inactive<\/code>\uff08\u672a\u89e6\u53d1\uff09\u6216 <code>pending<\/code>\uff08\u7b49\u5f85\u6301\u7eed\u65f6\u957f\uff09\u3002\u4f60\u53ef\u4ee5\u4e34\u65f6\u628a\u9608\u503c\u8c03\u4f4e\uff0c\u4eba\u4e3a\u5236\u9020\u4e00\u6b21\u89e6\u53d1\uff0c\u9a8c\u8bc1\u544a\u8b66\u94fe\u8def\u662f\u5426\u771f\u7684\u80fd\u9001\u5230\u4f60\u7684\u90ae\u7bb1\u6216\u624b\u673a\uff0c\u9a8c\u8bc1\u5b8c\u518d\u6539\u56de\u6b63\u5e38\u9608\u503c\u3002<\/p>\n<p>\u5e38\u89c1\u95ee\u9898\u6709\u4e24\u4e2a\u3002\u4e00\u662f <code>for<\/code> \u65f6\u957f\u8bbe\u7f6e\u8fc7\u77ed\u5bfc\u81f4\u9891\u7e41\u8bef\u62a5\uff0c\u5efa\u8bae\u81f3\u5c11 5 \u5206\u949f\u3002\u4e8c\u662f\u8868\u8fbe\u5f0f\u91cc\u6ca1\u6709\u6309 <code>instance<\/code> \u5206\u7ec4\uff0c\u5bfc\u81f4\u591a\u53f0\u670d\u52a1\u5668\u5171\u7528\u4e00\u6761\u544a\u8b66\u65f6\u65e0\u6cd5\u533a\u5206\u662f\u54ea\u53f0\u673a\u5668\u51fa\u95ee\u9898\uff0c\u52a1\u5fc5\u5728 <code>expr<\/code> \u4e2d\u52a0\u4e0a <code>by (instance)<\/code>\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/prometheus-server-practical-rule-validation.webp\" alt=\"Prometheus \u544a\u8b66\u89c4\u5219\u9a8c\u8bc1\u793a\u610f\u56fe\uff0c\u7eff\u8272\u76fe\u724c\u4e0e\u68c0\u67e5\u56fe\u6807\" loading=\"lazy\" \/><\/p>\n<h2>\u603b\u7ed3\u4e0e\u4e0b\u4e00\u6b65\u5efa\u8bae<\/h2>\n<p>Prometheus \u6307\u6807\u544a\u8b66\u89c4\u5219\u7684\u6838\u5fc3\u4ef7\u503c\uff0c\u662f\u628a&#8221;\u4e8b\u540e\u6551\u706b&#8221;\u53d8\u6210&#8221;\u4e8b\u524d\u9884\u8b66&#8221;\u3002\u6211\u4eec\u5efa\u8bae\u4f60\u5148\u4ece CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u4e09\u4e2a\u6700\u57fa\u7840\u7684\u6307\u6807\u5f00\u59cb\uff0c\u7528\u672c\u6587\u7ed9\u51fa\u7684\u8868\u8fbe\u5f0f\u642d\u5efa\u7b2c\u4e00\u5957\u89c4\u5219\uff0c\u518d\u9010\u6b65\u8865\u5145\u7f51\u7edc\u548c\u8d1f\u8f7d\u544a\u8b66\u3002\u544a\u8b66\u9608\u503c\u4e0d\u8981\u7167\u642c\uff0c\u8981\u6839\u636e\u81ea\u5df1\u670d\u52a1\u5668\u7684\u89c4\u683c\u548c\u4e1a\u52a1\u7279\u70b9\u8c03\u6574\uff0c\u907f\u514d\u8bef\u62a5\u548c\u6f0f\u62a5\u3002<\/p>\n<p>\u5982\u679c\u4f60\u9700\u8981\u4e00\u53f0\u7a33\u5b9a\u3001\u53ef\u6269\u5c55\u7684\u670d\u52a1\u5668\u6765\u627f\u8f7d\u76d1\u63a7\u7cfb\u7edf\uff0c\u53ef\u4ee5\u8003\u8651 Hostease \u7684 <a href=\"https:\/\/cn.hostease.com\/vps\/\">VPS<\/a>\uff08<a href=\"https:\/\/cn.hostease.com\/vps\/\">\u865a\u62df\u4e13\u7528\u670d\u52a1\u5668<\/a>\uff09\u4e3b\u673a\u65b9\u6848\uff0c\u5b83\u63d0\u4f9b\u72ec\u7acb\u7684 CPU \u548c\u5185\u5b58\u8d44\u6e90\uff0c\u9002\u5408\u90e8\u7f72 Prometheus \u8fd9\u7c7b\u5e38\u9a7b\u76d1\u63a7\u670d\u52a1\u3002\u914d\u7f6e\u597d\u544a\u8b66\u540e\uff0c\u5efa\u8bae\u5b9a\u671f\u68c0\u67e5\u89c4\u5219\u662f\u5426\u4ecd\u7136\u7b26\u5408\u5f53\u524d\u4e1a\u52a1\uff0c\u6bd4\u5982\u670d\u52a1\u5668\u6269\u5bb9\u540e\u53ca\u65f6\u8c03\u6574\u9608\u503c\u3002\u5982\u679c\u4f60\u9700\u8981\u66f4\u5b8c\u6574\u7684\u76d1\u63a7\u65b9\u6848\uff0c\u4e5f\u53ef\u4ee5\u53c2\u8003\u6211\u4eec\u5173\u4e8e<a href=\"https:\/\/cn.hostease.com\/blog\/guides\/ttfb-hosting-optimization\/\">\u7f51\u7ad9\u6027\u80fd\u4f18\u5316<\/a>\u7684\u5176\u4ed6\u6587\u7ae0\uff0c\u628a\u76d1\u63a7\u548c\u4f18\u5316\u7ed3\u5408\u8d77\u6765\uff0c\u8ba9\u7f51\u7ad9\u957f\u671f\u4fdd\u6301\u7a33\u5b9a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8bb2\u89e3\u5982\u4f55\u914d\u7f6e Prometheus \u6307\u6807\u544a\u8b66\u89c4\u5219\uff0c\u901a\u8fc7 CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u7b49\u5173\u952e\u6307\u6807\u5b9e\u73b0\u670d\u52a1\u5668\u9884\u8b66\uff0c\u9644\u5b8c\u6574\u914d\u7f6e\u793a\u4f8b\u4e0e\u6392\u969c\u5efa\u8bae\u3002<\/p>\n","protected":false},"author":2,"featured_media":33003,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3822],"tags":[3818,4670,3743,5021],"class_list":["post-33008","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","tag-prometheus","tag-4670","tag-3743","tag-5021"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/cn.hostease.com\/blog\/wp-content\/uploads\/2026\/09\/prometheus-server-practical-cover.webp","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/33008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/comments?post=33008"}],"version-history":[{"count":1,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/33008\/revisions"}],"predecessor-version":[{"id":33009,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/33008\/revisions\/33009"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/media\/33003"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/media?parent=33008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/categories?post=33008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/tags?post=33008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}