{"id":102426,"date":"2026-09-08T19:17:13","date_gmt":"2026-09-08T11:17:13","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/102426.html"},"modified":"2026-09-08T19:17:13","modified_gmt":"2026-09-08T11:17:13","slug":"jenkins-%e7%9b%91%e6%8e%a7%e4%b8%80%e6%9d%a1%e9%be%99%ef%bc%9a%e6%8e%a5%e5%85%a5%e3%80%81%e7%9c%8b%e6%9d%bf-9964%e3%80%8111-%e6%9d%a1%e5%91%8a%e8%ad%a6%e8%a7%84%e5%88%99%e7%9b%b4%e6%8e%a5%e6%8a%84","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/102426.html","title":{"rendered":"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70"},"content":{"rendered":"<p>&#x1f4dd; \u6458\u8981&#xff1a;\u7ed9 Jenkins \u914d\u4e00\u5957\u5b8c\u6574\u76d1\u63a7&#xff0c;\u4e00\u6761\u9f99\u8d70\u5b8c\u56db\u6b65&#xff1a;\u88c5 Prometheus metrics \u63d2\u4ef6\u63a5\u5165&#xff08;\u4e24\u884c\u914d\u7f6e&#xff0c;\u26a0\ufe0f \u6307\u6807\u540d\u524d\u7f00\u53ef\u914d&#xff0c;\u7167\u6284\u7f51\u4e0a\u7684\u591a\u534a\u5bf9\u4e0d\u4e0a\u4f60\u7684&#xff09;\u3001\u5bfc Grafana \u770b\u677f 9964&#xff08;19 \u4e2a\u9762\u677f\u9010\u5757\u5b9e\u6d4b&#xff0c;4 \u4e2a No data\u30011 \u4e2a\u6570\u662f\u9519\u7684\u90fd\u6807\u51fa\u6765\u4e86&#xff09;\u300111 \u6761\u544a\u8b66\u89c4\u5219&#xff08;\u4ece Jenkinsfile \u53cd\u6a21\u5f0f\u53cd\u63a8&#xff0c;\u4e0d\u662f\u7167\u6307\u6807\u5217\u8868\u5806\u7684&#xff1b;\u5df2\u8fc7 promtool \u6821\u9a8c\u5e76\u771f\u5b9e\u52a0\u8f7d\u8fd0\u884c&#xff09;\u3001\u4ee5\u53ca\u914d\u5b8c\u4e4b\u540e\u600e\u4e48\u7528\u4e24\u5206\u949f\u786e\u8ba4\u5b83\u4eec\u4e0d\u662f\u54d1\u5f39\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908111708-6a9feeb4c8618.png\" alt=\"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\u5c01\u9762\uff1a\u63a5\u5165\u3001\u770b\u677f\u3001\u544a\u8b66\uff0c\u56db\u6b65\u914d\u5b8c\u2014\u2014\u56db\u6b65\u6d41\u7a0b\u6761 \u88c5\u63d2\u4ef6\u63a5\u5165 \u2192 \u5bfc\u770b\u677f 9964 \u2192 11 \u6761\u544a\u8b66\u89c4\u5219 \u2192 \u786e\u8ba4\u5b83\u4eec\u4e0d\u662f\u54d1\u5f39\uff1b\u4e09\u5f20\u5361\u5206\u522b\u662f \u2460 \u63a5\u5165 \u4e00\u4e2a\u63d2\u4ef6\u4e24\u884c\u914d\u7f6e\u3001\u62ff\u5230\u5b9e\u6d4b 369 \u4e2a\u6307\u6807\u7684\u771f\u5b9e\u540d\u5b57\uff08\u524d\u7f00\u53ef\u914d\uff0c\u7167\u6284\u7f51\u4e0a\u7684\u5bf9\u4e0d\u4e0a\uff09\uff0c\u2461 \u770b\u677f \u5bfc 9964 \u586b\u4e2a\u6570\u636e\u6e90\u300119 \u4e2a\u9762\u677f\u9010\u5757\u5b9e\u6d4b\uff084 \u4e2a No data\u30011 \u4e2a\u6570\u662f\u9519\u7684\uff09\uff0c\u2462 \u544a\u8b66 11 \u6761\u89c4\u5219\u76f4\u63a5\u6284\u8d70\u3001\u4ece Jenkinsfile \u53cd\u6a21\u5f0f\u53cd\u63a8\u5e76\u5df2\u8fc7 promtool \u4e0e\u771f\u5b9e\u52a0\u8f7d\u8fd0\u884c\" \/><\/p>\n<p>\u8d77\u56e0\u662f\u4e00\u6b21\u968f\u624b\u7684 curl\u3002<\/p>\n<p>\u6211\u628a\u8fd9\u53f0 Jenkins \u7684 \/prometheus\/ \u7aef\u70b9\u6293\u4e0b\u6765&#xff0c;\u60f3\u6311\u51e0\u4e2a\u6307\u6807\u5199\u544a\u8b66\u89c4\u5219&#xff0c;\u7ffb\u5230\u6784\u5efa\u90a3\u4e00\u6bb5\u65f6\u770b\u5230\u8fd9\u4e48\u4e00\u884c&#xff1a;<\/p>\n<p>default_jenkins_builds_running_build_duration_milliseconds{jenkins_job&#061;&#034;order-sync\/com.example:order-sync-api&#034;} 1.805391805E9<\/p>\n<p>1,805,391,805 \u6beb\u79d2\u3002\u6362\u7b97\u4e00\u4e0b\u2014\u2014\u8fd9\u4e2a\u6784\u5efa\u5df2\u7ecf\u300c\u6b63\u5728\u8fd0\u884c\u300d20.9 \u5929\u4e86\u3002<\/p>\n<p>\u5b83\u8eba\u4e86\u4e09\u5468&#xff0c;\u6ca1\u6709\u4efb\u4f55\u4eba\u77e5\u9053\u2014\u2014\u56e0\u4e3a\u8fd9\u53f0 Jenkins \u4e0a\u4e00\u6761\u544a\u8b66\u89c4\u5219\u90fd\u6ca1\u6709\u3002\u8bf4\u6765\u6709\u70b9\u8bbd\u523a&#xff1a;\u540c\u4e00\u5957 Prometheus \u7684\u89c4\u5219\u76ee\u5f55\u91cc&#xff0c;ClickHouse\u3001Flink\u3001Redis\u3001ZooKeeper\u3001Kafka\u3001MySQL\u3001MongoDB\u3001Elasticsearch\u3001MinIO\u3001RocketMQ\u3001DolphinScheduler \u2014\u2014 \u5341\u6765\u4e2a\u7ec4\u4ef6&#xff0c;\u6bcf\u4e2a\u90fd\u6709\u4e00\u4efd\u81ea\u5df1\u7684 *-rules.yml&#xff0c;\u53e6\u5916\u8fd8\u6709 5 \u4e2a\u4e3b\u673a\u7ea7\u7684\u901a\u7528\u89c4\u5219\u6587\u4ef6&#xff08;CPU \/ \u5185\u5b58 \/ \u78c1\u76d8 \/ \u5b58\u6d3b&#xff09;\u3002\u552f\u72ec Jenkins&#xff0c;\u4e00\u6761\u90fd\u6ca1\u6709\u3002<\/p>\n<p>\u4e8e\u662f\u6709\u4e86\u8fd9\u7bc7&#xff1a;\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219&#xff0c;\u56db\u6b65\u914d\u5b8c\u2014\u2014\u89c4\u5219\u5728\u7b2c\u4e94\u8282&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u6284\u8d70\u3002<\/p>\n<p>\u56db\u6b65\u91cc\u6bcf\u4e00\u6b65\u90fd\u6709\u4e2a\u5751&#xff0c;\u6211\u5728\u6b63\u6587\u5bf9\u5e94\u4f4d\u7f6e\u5c31\u5730\u6807\u51fa\u6765\u4e86&#xff0c;\u7167\u7740\u8d70\u4e0d\u7528\u81ea\u5df1\u518d\u8e29\u4e00\u904d&#xff1a;<\/p>\n<ul>\n<li>\u7b2c\u4e00\u6b65\u63a5\u5165\u5b8c&#xff0c;\u6307\u6807\u540d\u522b\u7167\u6284\u7f51\u4e0a\u7684\u2014\u2014\u524d\u7f00\u662f\u53ef\u914d\u7684&#xff0c;\u6284\u6765\u7684\u89c4\u5219\u6c38\u8fdc\u4e0d\u4f1a\u89e6\u53d1&#xff08;\u7b2c\u4e09\u8282&#xff09;&#xff1b;<\/li>\n<li>\u7b2c\u4e8c\u6b65\u770b\u677f\u5bfc\u5b8c&#xff0c;\u9010\u5757\u770b\u6709\u6ca1\u6709\u6570\u2014\u20149964 \u6211\u5b9e\u6d4b 19 \u4e2a\u9762\u677f&#xff0c;4 \u4e2a No data&#xff0c;\u8fd8\u6709 1 \u4e2a\u663e\u793a\u300c750 \u4ebf %\u300d&#xff08;4.1&#xff09;&#xff1b;<\/li>\n<li>\u7b2c\u4e09\u6b65\u89c4\u5219\u5199\u5b8c&#xff0c;\u5148 promtool \u518d\u4e0a\u7ebf\u2014\u2014\u5199\u9519\u4e00\u884c&#xff0c;Prometheus \u4e0d\u662f\u8df3\u8fc7\u90a3\u6761\u89c4\u5219&#xff0c;\u662f\u62d2\u7edd\u542f\u52a8&#xff0c;\u540c\u4e00\u53f0\u673a\u4e0a\u5341\u51e0\u4e2a\u7ec4\u4ef6\u7684\u544a\u8b66\u8ddf\u7740\u4e00\u8d77\u505c&#xff08;6.1&#xff0c;\u6211\u5c31\u683d\u5728\u8fd9\u513f&#xff09;&#xff1b;<\/li>\n<li>\u7b2c\u56db\u6b65\u52a0\u8f7d\u5b8c&#xff0c;\u300c\u4e00\u7247\u7eff\u300d\u8981\u9a8c\u8fc7\u624d\u7b97\u6570\u2014\u2014\u8868\u8fbe\u5f0f\u6c38\u8fdc\u8fd4\u56de\u7a7a\u7684\u54d1\u5f39&#xff0c;\u957f\u5f97\u548c\u300c\u786e\u5b9e\u6ca1\u95ee\u9898\u300d\u4e00\u6a21\u4e00\u6837&#xff08;\u7b2c\u516d\u8282&#xff09;\u3002<\/li>\n<\/ul>\n<p>&#xff08;\u5f00\u5934\u90a3\u6761\u6784\u5efa\u540e\u6765\u6211\u8ffd\u4e86\u5f88\u4e45&#xff1a;\u5b83\u85cf\u5728\u54ea\u513f\u3001\u4e3a\u4ec0\u4e48 abort \u6309\u94ae\u70b9\u4e0b\u53bb\u7eb9\u4e1d\u4e0d\u52a8&#xff0c;\u662f\u53e6\u4e00\u7bc7\u7684\u4e8b\u2014\u2014\u3010\u5f85\u53d1\u5e03\u540e\u8865\u5145\u5f15\u7528\u5173\u7cfb&#xff1a;\u300aJenkins \u6784\u5efa\u5361\u4e86 23 \u5929&#xff0c;abort \u6309\u94ae\u70b9\u4e86\u6ca1\u7528\u300b\u3011\u3002&#xff09;<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u4e3a\u4ec0\u4e48 Jenkins \u6700\u5bb9\u6613\u88ab\u6f0f\u6389<\/h3>\n<p>\u4e0d\u662f\u5fd8\u4e86&#xff0c;\u662f\u5b83\u7684\u6545\u969c\u5f62\u6001\u548c\u522b\u7684\u7ec4\u4ef6\u4e0d\u4e00\u6837\u3002<\/p>\n<p>Redis \u6302\u4e86&#xff0c;\u4e1a\u52a1\u7acb\u523b\u62a5\u9519&#xff1b;MySQL \u6302\u4e86&#xff0c;\u7535\u8bdd\u9a6c\u4e0a\u6253\u8fc7\u6765\u3002\u8fd9\u7c7b\u7ec4\u4ef6\u4e0d\u914d\u544a\u8b66\u4f60\u4e5f\u625b\u4e0d\u8fc7\u4e94\u5206\u949f\u3002<\/p>\n<p>Jenkins \u4e0d\u662f&#xff1a;<\/p>\n<table>\n<tr>\u6545\u969c\u8c01\u4f1a\u53d1\u73b0\u591a\u4e45<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">Jenkins \u8fdb\u7a0b\u6302\u4e86<\/td>\n<td align=\"left\">\u6240\u6709\u4eba<\/td>\n<td align=\"left\">\u4e0b\u4e00\u6b21\u53d1\u7248&#xff0c;\u51e0\u5206\u949f\u5185<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6784\u5efa\u5361\u6b7b\u4e0d\u9000\u51fa<\/td>\n<td align=\"left\">\u6ca1\u4eba<\/td>\n<td align=\"left\">\u2b50 \u53ef\u4ee5\u8eba\u4e09\u5468<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">executor \u88ab\u5360\u6ee1<\/td>\n<td align=\"left\">\u53ea\u6709\u6392\u961f\u7684\u4eba\u9a82\u4e24\u53e5<\/td>\n<td align=\"left\">\u534a\u5929<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">controller \u5185\u5b58\u88ab\u5403\u6389<\/td>\n<td align=\"left\">\u7b49\u5b83 OOM \u90a3\u5929<\/td>\n<td align=\"left\">\u51e0\u5468<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u8282\u70b9\u6389\u7ebf<\/td>\n<td align=\"left\">\u6784\u5efa\u53d8\u6162\u65f6\u624d\u6709\u4eba\u67e5<\/td>\n<td align=\"left\">\u6570\u5929<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Jenkins \u6302\u4e86\u5927\u5bb6\u7acb\u523b\u77e5\u9053\u2014\u2014\u53d1\u4e0d\u4e86\u7248\u662f\u6700\u54cd\u7684\u544a\u8b66\u3002\u771f\u6b63\u6ca1\u4eba\u77e5\u9053\u7684&#xff0c;\u662f\u5b83\u300c\u8fd8\u6d3b\u7740\u4f46\u5df2\u7ecf\u4e0d\u5e72\u6d3b\u4e86\u300d\u3002 \u4e0a\u8868\u91cc\u300c\u53ef\u4ee5\u8eba\u4e09\u5468\u300d\u90a3\u4e00\u884c\u4e0d\u662f\u4fee\u8f9e&#xff0c;\u5c31\u662f\u5f00\u5934\u90a3\u6761\u6784\u5efa\u2014\u2014\u5b83\u6700\u540e\u662f\u88ab\u7b2c\u4e94\u8282\u90a3\u6761\u89c4\u5219\u635e\u51fa\u6765\u7684\u3002<\/p>\n<p>\u8fd9\u53e5\u8bdd\u4f60\u8981\u662f\u89c9\u5f97\u773c\u719f&#xff1a;\u6211\u5728\u300aJenkinsfile \u53cd\u6a21\u5f0f\u56fe\u9274\u300b\u91cc\u82b1\u4e86\u4e00\u6574\u8282\u8bb2\u300c\u8fdb\u7a0b\u6d3b\u7740 \u2260 \u5b83\u5728\u5e72\u6d3b\u300d&#xff0c;\u53ea\u4e0d\u8fc7\u90a3\u7bc7\u7684\u4e3b\u89d2\u662f\u6d41\u6c34\u7ebf&#xff0c;\u8fd9\u7bc7\u7684\u4e3b\u89d2\u662f Jenkins \u81ea\u5df1\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u63a5\u5165&#xff1a;\u4e00\u4e2a\u63d2\u4ef6&#xff0c;\u4e24\u884c\u914d\u7f6e<\/h3>\n<p>\u524d\u7f6e&#xff1a;Prometheus &#043; Grafana &#043; Alertmanager \u8fd9\u5957\u600e\u4e48\u642d&#xff0c;\u89c1\u300aPrometheus &#043; Grafana &#043; AlertManager \u76d1\u63a7\u4f53\u7cfb\u642d\u5efa&#xff1a;Docker \u4e00\u628a\u68ad\u300b&#xff0c;\u672c\u7bc7\u53ea\u8bb2 Jenkins \u8fd9\u4e00\u6bb5\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65&#xff1a;Jenkins \u88c5 Prometheus metrics \u63d2\u4ef6&#xff08;Manage Jenkins \u2192 Plugins \u641c Prometheus metrics&#xff09;\u3002\u88c5\u5b8c\u9ed8\u8ba4\u5c31\u5728 \/prometheus\/ \u66b4\u9732\u6307\u6807&#xff0c;\u4e0d\u7528\u6539\u4efb\u4f55\u914d\u7f6e\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff1a;Prometheus \u52a0\u4e00\u4e2a job&#xff1a;<\/p>\n<p>  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">job_name<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;jenkins&#039;<\/span><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;jenkins.example.com:8080&#039;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token key atrule\">metrics_path<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;\/prometheus\/&#039;<\/span>        <span class=\"token comment\"># \u26a0\ufe0f \u7ed3\u5c3e\u8fd9\u4e2a\u659c\u6760\u4e0d\u80fd\u5c11<\/span><\/p>\n<p>metrics_path \u9ed8\u8ba4\u662f \/metrics&#xff0c;Jenkins \u63d2\u4ef6\u7528\u7684\u662f \/prometheus\/&#xff0c;\u5fd8\u4e86\u6539\u5c31\u662f\u4e00\u8def 404\u3002<\/p>\n<p>\u9a8c\u8bc1&#xff1a;<\/p>\n<p><span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-s<\/span> http:\/\/jenkins.example.com:8080\/prometheus\/ <span class=\"token operator\">|<\/span> <span class=\"token function\">head<\/span> <span class=\"token parameter variable\">-5<\/span><\/p>\n<p>\u6709 # HELP default_jenkins_&#8230; \u5c31\u901a\u4e86\u3002<\/p>\n<p>\u4e0d\u8fc7 curl \u901a\u53ea\u8bf4\u660eJenkins \u8fd9\u8fb9\u5728\u5410\u6307\u6807&#xff0c;\u8fd8\u5f97\u786e\u8ba4Prometheus \u771f\u7684\u5728\u6293\u2014\u2014\u53bb Status \u2192 Target health&#xff0c;\u641c jenkins&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908111710-6a9feeb6d0237.png\" alt=\"Prometheus Target health \u9875\u9762\uff1ajob \u4e3a jenkins \u7684\u6293\u53d6\u76ee\u6807\u663e\u793a 1 \/ 1 up\uff0cEndpoint \u662f http:\/\/jenkins.example.com:8080\/prometheus\/\uff0c\u6807\u7b7e\u4e3a instance=jenkins.example.com:8080 \u4e0e job=jenkins\uff0cLast scrape 8.369 \u79d2\u524d\u3001\u8017\u65f6 6ms\uff0cState \u4e3a UP\" \/><\/p>\n<p>\u56fe&#xff1a;1 \/ 1 up\u3001State UP&#xff0c;Endpoint \u7ed3\u5c3e\u90a3\u4e2a\u659c\u6760\u4e5f\u5728\u3002\u914d\u9519\u7684\u5178\u578b\u75c7\u72b6\u662f\u8fd9\u91cc\u538b\u6839\u6ca1\u6709 jenkins \u8fd9\u4e2a job&#xff08;\u914d\u7f6e\u6ca1\u751f\u6548&#xff09;&#xff0c;\u6216\u8005 State \u662f DOWN \u5e76\u5e26\u4e00\u884c 404&#xff08;metrics_path \u5fd8\u4e86\u6539&#xff09;\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u26a0\ufe0f \u6307\u6807\u540d\u522b\u7167\u6284\u7f51\u4e0a\u7684&#xff0c;\u524d\u7f00\u662f\u53ef\u914d\u7684<\/h3>\n<p>\u8fd9\u662f\u7b2c\u4e00\u4e2a\u5751&#xff0c;\u800c\u4e14\u5f88\u591a\u4eba\u662f\u914d\u5b8c\u53d1\u73b0\u544a\u8b66\u6c38\u8fdc\u4e0d\u89e6\u53d1\u624d\u56de\u5934\u67e5\u7684\u3002<\/p>\n<p>\u63d2\u4ef6\u7684\u6307\u6807\u5e26\u4e00\u4e2a\u53ef\u914d\u7f6e\u7684\u547d\u540d\u7a7a\u95f4\u524d\u7f00&#xff0c;\u9ed8\u8ba4\u662f default&#xff0c;\u6240\u4ee5\u4f60\u770b\u5230\u7684\u662f&#xff1a;<\/p>\n<p>default_jenkins_executors_available<br \/>\ndefault_jenkins_builds_duration_milliseconds_summary<\/p>\n<p>\u8fd9\u4e2a\u524d\u7f00\u53ef\u4ee5\u5728\u63d2\u4ef6\u914d\u7f6e\u9875\u7684 Default Namespace \u6539&#xff0c;\u4e5f\u80fd\u7528\u73af\u5883\u53d8\u91cf PROMETHEUS_NAMESPACE \u8986\u76d6\u3002\u7f51\u4e0a\u6587\u7ae0\u5199 jenkins_executors_* \u7684\u3001\u5199 default_jenkins_* \u7684\u90fd\u6709\u2014\u2014\u53d6\u51b3\u4e8e\u4f5c\u8005\u90a3\u53f0\u673a\u5668\u600e\u4e48\u914d\u7684&#xff0c;\u7167\u6284\u5927\u6982\u7387\u5bf9\u4e0d\u4e0a\u4f60\u7684\u3002<\/p>\n<p>\u21d2 \u52a8\u624b\u524d\u5148\u81ea\u5df1\u635e\u4e00\u904d&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u770b\u90fd\u6709\u54ea\u4e9b\u6307\u6807&#xff08;\u6211\u8fd9\u53f0\u5b9e\u6d4b 369 \u4e2a&#xff09;<\/span><br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-s<\/span> http:\/\/jenkins.example.com:8080\/prometheus\/ <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token string\">&#039;^# HELP&#039;<\/span><\/p>\n<p><span class=\"token comment\"># \u635e\u4f60\u8981\u7528\u7684\u90a3\u51e0\u7c7b<\/span><br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-s<\/span> http:\/\/jenkins.example.com:8080\/prometheus\/ <span class=\"token punctuation\">\\\\<\/span><br \/>\n  <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-iE<\/span> <span class=\"token string\">&#039;queue|executor|builds?_duration|jvm_memory&#039;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-v<\/span> <span class=\"token string\">&#039;^#&#039;<\/span><\/p>\n<h4>3.1 369 \u4e2a\u6307\u6807\u91cc&#xff0c;\u771f\u6b63\u8be5\u770b\u7684\u5341\u6765\u4e2a<\/h4>\n<p>\u63d2\u4ef6\u5410\u5f97\u5f88\u5168&#xff08;JVM\u3001GC\u3001\u7ebf\u7a0b\u6c60\u3001\u6bcf\u4e2a Job \u7684\u5386\u53f2\u2026\u2026&#xff09;&#xff0c;\u4f46\u5199\u544a\u8b66\u53ea\u9700\u8981\u8fd9\u51e0\u7c7b\u3002\u4e0b\u8868\u7684\u6307\u6807\u540d\u662f 2026-09 \u5b9e\u6d4b\u6293\u4e0b\u6765\u7684&#xff1a;<\/p>\n<table>\n<tr>\u5173\u6ce8\u4ec0\u4e48\u6307\u6807\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u961f\u5217<\/td>\n<td align=\"left\">jenkins_queue_size_value<\/td>\n<td align=\"left\">\u6392\u961f\u603b\u6570<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><\/td>\n<td align=\"left\">jenkins_queue_stuck_value<\/td>\n<td align=\"left\">\u2b50 Jenkins \u81ea\u5df1\u5224\u5b9a\u300c\u5361\u4f4f\u300d\u7684&#xff0c;\u6bd4\u4f60\u81ea\u5df1\u5b9a\u9608\u503c\u51c6<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><\/td>\n<td align=\"left\">jenkins_queue_blocked_value \/ _pending_value<\/td>\n<td align=\"left\">\u7ec6\u5206\u72b6\u6001<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6267\u884c\u5668<\/td>\n<td align=\"left\">jenkins_executor_count_value<\/td>\n<td align=\"left\">\u603b\u6570<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><\/td>\n<td align=\"left\">jenkins_executor_in_use_value \/ _free_value<\/td>\n<td align=\"left\">\u5360\u7528 \/ \u7a7a\u95f2<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><\/td>\n<td align=\"left\">default_jenkins_executors_*{label&#061;&#034;&#8230;&#034;}<\/td>\n<td align=\"left\">\u6309\u8282\u70b9\u6807\u7b7e\u5206\u7ec4\u7684\u7248\u672c<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u8282\u70b9<\/td>\n<td align=\"left\">jenkins_node_online_value \/ _offline_value<\/td>\n<td align=\"left\">\u5728\u7ebf \/ \u79bb\u7ebf\u6570<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6784\u5efa<\/td>\n<td align=\"left\">default_jenkins_builds_running_build_duration_milliseconds<\/td>\n<td align=\"left\">\u2b50 \u5f53\u524d\u5728\u8dd1\u7684\u6784\u5efa\u5df2\u8dd1\u591a\u4e45&#xff0c;\u672c\u6587\u5f00\u5934\u90a3\u6761\u5c31\u662f\u5b83<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><\/td>\n<td align=\"left\">default_jenkins_builds_last_build_waiting_milliseconds<\/td>\n<td align=\"left\">\u4e0a\u6b21\u6784\u5efa\u6392\u961f\u7b49\u4e86\u591a\u4e45<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><\/td>\n<td align=\"left\">default_jenkins_builds_total_build_count_total<\/td>\n<td align=\"left\">\u6784\u5efa\u603b\u6570&#xff08;counter&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><\/td>\n<td align=\"left\">default_jenkins_builds_failed_build_count_total<\/td>\n<td align=\"left\">\u5931\u8d25\u6570&#xff08;counter&#xff09;<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">JVM<\/td>\n<td align=\"left\">jvm_memory_bytes_used{area&#061;&#034;heap&#034;} \/ jvm_memory_bytes_max{area&#061;&#034;heap&#034;}<\/td>\n<td align=\"left\">controller \u5806<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u63d2\u4ef6<\/td>\n<td align=\"left\">jenkins_plugins_failed \/ _active \/ _inactive<\/td>\n<td align=\"left\">\u63d2\u4ef6\u52a0\u8f7d\u72b6\u6001<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4a1; \u4e24\u5957\u547d\u540d\u6df7\u7740\u51fa\u73b0\u662f\u6b63\u5e38\u7684&#xff1a;default_jenkins_* \u6765\u81ea\u63d2\u4ef6\u81ea\u5df1\u7684\u91c7\u96c6\u5668&#xff0c;jenkins_* \/ vm_* \u662f\u4ece Jenkins \u5185\u7f6e\u7684 Metrics \u63d2\u4ef6&#xff08;Dropwizard&#xff09;\u8f6c\u6362\u8fc7\u6765\u7684\u3002\u524d\u8005\u5e26\u53ef\u914d\u524d\u7f00&#xff0c;\u540e\u8005\u4e0d\u5e26\u2014\u2014\u6240\u4ee5\u4f60\u4f1a\u5728\u540c\u4e00\u4efd\u8f93\u51fa\u91cc\u770b\u5230\u4e24\u79cd\u98ce\u683c&#xff0c;\u522b\u4ee5\u4e3a\u662f\u6293\u9519\u4e86\u3002<\/p>\n<hr \/>\n<h3>\u56db\u3001\u770b\u677f&#xff1a;\u76f4\u63a5\u5bfc 9964<\/h3>\n<p>Grafana \u5b98\u65b9\u5e02\u573a\u7684 9964 \u00b7 Jenkins: Performance and Health Overview&#xff0c;\u5c31\u662f\u914d\u8fd9\u4e2a\u63d2\u4ef6\u7528\u7684&#xff0c;\u5bfc\u5165\u586b\u4e00\u4e0b Prometheus \u6570\u636e\u6e90\u5373\u53ef\u3002<\/p>\n<p>\u26a0\ufe0f \u4e24\u4e2a\u63d0\u9192&#xff1a;<\/p>\n<li>\u522b\u5bfc\u9519\u2014\u2014\u5e02\u573a\u4e0a\u8fd8\u6709\u4e2a\u51e0\u4e4e\u540c\u540d\u7684 9524&#xff0c;\u540c\u6837\u662f\u7ed9 jenkinsci\/prometheus-plugin \u7528\u7684&#xff0c;\u4f46\u9762\u677f\u66f4\u5c11&#xff08;9964 \u7684\u63cf\u8ff0\u591a\u51fa Jenkins Job Status \u7b49\u4e00\u6279&#xff09;\u3002\u522b\u770b\u5230\u300cJenkins performance and health overview\u300d\u5c31\u968f\u624b\u5bfc 9524&#xff0c;\u5bfc\u5b8c\u4f1a\u53d1\u73b0\u5c11\u4e00\u534a\u56fe\u3002<\/li>\n<li>\u2b50 \u5bfc\u5b8c\u4e00\u5b9a\u9010\u5757\u770b\u6709\u6ca1\u6709\u6570\u636e\u3002\u793e\u533a\u770b\u677f\u666e\u904d\u5b58\u5728\u300c\u6307\u6807\u540d\u968f\u7248\u672c\u6539\u4e86\u3001\u770b\u677f\u6ca1\u8ddf\u4e0a\u300d\u7684\u95ee\u9898&#xff0c;\u5178\u578b\u75c7\u72b6\u662f\u6ee1\u5c4f No Data&#xff0c;\u53ea\u6709 Uptime \u6709\u6570&#xff08;\u8fd9\u6b21\u6070\u597d\u53cd\u8fc7\u6765\u2014\u2014\u4e0b\u9762\u4f60\u4f1a\u770b\u5230&#xff0c;\u504f\u504f\u5c31\u662f Uptime \u6ca1\u6570&#xff09;\u3002\u6211\u5728 MinIO \u4e0a\u5c31\u5403\u8fc7\u8fd9\u4e2a\u4e8f&#xff1a;\u793e\u533a\u90a3\u51e0\u4e2a\u7f16\u53f7&#xff08;6248 \/ 10946 \/ 12563&#xff09;\u7528\u7684\u8fd8\u662f 2018\u20132020 \u7684\u65e7\u6307\u6807\u540d&#xff0c;\u5bfc\u8fdb\u53bb\u57fa\u672c\u5168\u7a7a\u3002<\/li>\n<h4>4.1 \u5b9e\u6d4b&#xff1a;19 \u4e2a\u9762\u677f&#xff0c;4 \u4e2a\u6ca1\u6570\u636e&#xff0c;1 \u4e2a\u66f4\u7cdf<\/h4>\n<p>\u5bfc\u5b8c\u957f\u8fd9\u6837&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908111711-6a9feeb702297.png\" alt=\"Grafana 9964 Jenkins Performance and Health Overview \u770b\u677f\u5b9e\u6d4b\uff1a19 \u4e2a\u9762\u677f\u4e2d JVM Uptime\u3001Total Jobs\u3001Aborted Jobs\u3001Unstable Jobs \u56db\u4e2a\u663e\u793a No data\uff0cJVM free memory \u663e\u793a 75040825700.0% \u8fd9\u79cd\u660e\u663e\u9519\u8bef\u7684\u6570\u503c\uff0c\u5176\u4f59 14 \u4e2a\u9762\u677f\u6b63\u5e38\u6709\u6570\" \/><\/p>\n<p>\u56fe&#xff1a;9964 \u5bfc\u5165\u540e\u7684\u5b9e\u9645\u6548\u679c\u3002\u6ce8\u610f\u5de6\u4fa7\u90a3\u4e2a JVM free memory \u2014\u2014 \u5b83\u4e0d\u662f No data&#xff0c;\u5b83\u663e\u793a\u7684\u662f\u300c750 \u4ebf\u767e\u5206\u6bd4\u300d\u3002<\/p>\n<p>\u9010\u5757\u770b\u4e0b\u6765&#xff1a;<\/p>\n<table>\n<tr>\u72b6\u6001\u9762\u677f\u6570\u91cf<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u2705 \u6b63\u5e38<\/td>\n<td align=\"left\">Memory Usage\u3001Jenkins health\u3001CPU Usage\u3001Failed Jobs\u3001Executor free \/ In-use\u3001Job Duration\u3001\u961f\u5217\u76f8\u5173\u2026\u2026<\/td>\n<td align=\"center\">14<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u26a0\ufe0f No data<\/td>\n<td align=\"left\">JVM Uptime\u3001Total Jobs\u3001Aborted Jobs\u3001Unstable Jobs<\/td>\n<td align=\"center\">4<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">&#x1f534; \u6709\u6570\u4f46\u662f\u9519\u7684<\/td>\n<td align=\"left\">JVM free memory &#061; 75040825700.0%<\/td>\n<td align=\"center\">1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e24\u4e2a\u503c\u5f97\u8bf4\u7684\u5730\u65b9&#xff1a;<\/p>\n<p>\u2460 Total Jobs \u6ca1\u6570\u636e&#xff0c;\u53ef Sucessful Jobs \u6709 5359\u3001Failed Jobs \u6709 97\u3002&#xff08;Sucessful \u8fd9\u4e2a\u62fc\u5199\u662f\u770b\u677f\u81ea\u5e26\u7684&#xff0c;\u4e0d\u662f\u6211\u6253\u9519&#xff09; \u540c\u4e00\u7ec4\u6307\u6807\u4e00\u534a\u53d6\u5f97\u5230\u4e00\u534a\u53d6\u4e0d\u5230\u2014\u2014\u8fd9\u662f\u793e\u533a\u770b\u677f\u7684\u5178\u578b\u75c7\u72b6&#xff1a;\u770b\u677f\u7684\u67e5\u8be2\u8bed\u53e5\u505c\u7559\u5728\u67d0\u4e2a\u65e7\u7248\u672c\u7684\u6307\u6807\u540d\u4e0a&#xff0c;\u63d2\u4ef6\u6539\u540d\u540e\u6ca1\u4eba\u8ddf\u3002\u6240\u4ee5\u7b2c\u4e09\u8282\u624d\u53cd\u590d\u5f3a\u8c03\u300c\u5148\u81ea\u5df1\u635e\u4e00\u904d\u6307\u6807\u540d\u300d\u3002<\/p>\n<p>\u2461 &#x1f534; \u90a3\u4e2a 750 \u4ebf\u767e\u5206\u6bd4&#xff0c;\u6bd4 No data \u5371\u9669\u5f97\u591a\u3002<\/p>\n<p>No data \u662f\u8bda\u5b9e\u7684\u574f\u2014\u2014\u4f60\u4e00\u773c\u770b\u51fa\u8fd9\u5757\u4e0d\u80fd\u4fe1\u3002\u800c\u4e00\u4e2a\u6e32\u67d3\u51fa\u5177\u4f53\u6570\u5b57\u3001\u8fd8\u5e26\u7740\u767e\u5206\u53f7\u7684\u9762\u677f&#xff0c;\u770b\u7740\u5b8c\u5168\u6b63\u5e38\u3002\u4f60\u8981\u662f\u6ca1\u591a\u60f3&#xff0c;\u5c31\u4f1a\u628a\u5b83\u5f53\u6210\u4e00\u4e2a\u771f\u5b9e\u8bfb\u6570\u3002<\/p>\n<p>\u8fd9\u5176\u5b9e\u662f\u672c\u6587\u53cd\u590d\u5728\u8bb2\u7684\u540c\u4e00\u4e2a\u6a21\u5f0f&#xff0c;\u53ea\u4e0d\u8fc7\u6362\u4e86\u4e2a\u5730\u65b9\u51fa\u73b0&#xff1a;<\/p>\n<p>\u574f\u6389\u7684\u4e1c\u897f\u4f2a\u88c5\u6210\u6b63\u5e38&#xff0c;\u6bd4\u660e\u663e\u7684\u574f\u66f4\u96be\u5bf9\u4ed8\u3002<\/p>\n<p>\u6784\u5efa\u50f5\u5728\u90a3\u91cc 21 \u5929\u6ca1\u4eba\u53d1\u73b0&#xff0c;\u662f\u56e0\u4e3a\u5b83\u300c\u770b\u7740\u5728\u8dd1\u300d&#xff1b;\u4e00\u6761\u54d1\u5f39\u544a\u8b66\u9a97\u8fc7\u4f60&#xff0c;\u662f\u56e0\u4e3a\u5b83\u300c\u770b\u7740\u4e00\u7247\u7eff\u300d&#xff1b;\u8fd9\u4e2a\u9762\u677f\u9a97\u8fc7\u4f60&#xff0c;\u662f\u56e0\u4e3a\u5b83\u300c\u770b\u7740\u6709\u6570\u300d\u3002<\/p>\n<p>\u21d2 \u5b9e\u64cd\u5efa\u8bae&#xff1a;\u5bfc\u5b8c\u770b\u677f\u522b\u53ea\u626b\u4e00\u773c\u300c\u6709\u6ca1\u6709 No data\u300d&#xff0c;\u8fd8\u8981\u770b\u90a3\u4e9b\u6709\u6570\u7684\u9762\u677f&#xff0c;\u6570\u503c\u91cf\u7ea7\u5408\u4e0d\u5408\u7406\u3002\u767e\u5206\u6bd4\u8d85\u8fc7 100\u3001\u5185\u5b58\u662f\u8d1f\u6570\u3001\u8017\u65f6\u662f\u5929\u7ea7\u2014\u2014\u8fd9\u4e9b\u90fd\u662f\u67e5\u8be2\u6216\u5355\u4f4d\u914d\u9519\u7684\u4fe1\u53f7\u3002<\/p>\n<p>&#x1f4cc; \u8bda\u5b9e\u8fb9\u754c&#xff1a;\u4e0a\u9762\u8fd9 4 \u4e2a No data \u548c 1 \u4e2a\u9519\u503c&#xff0c;\u6211\u53ea\u5b9a\u4f4d\u5230\u300c\u770b\u677f\u67e5\u8be2\u4e0e\u5f53\u524d\u6307\u6807\u540d\u5bf9\u4e0d\u4e0a\u300d\u8fd9\u4e00\u5c42&#xff0c;\u6ca1\u6709\u9010\u4e2a\u53bb\u6539\u770b\u677f\u7684\u67e5\u8be2\u8bed\u53e5\u3002\u8981\u4fee\u7684\u8bdd&#xff0c;\u601d\u8def\u662f\u6253\u5f00\u9762\u677f\u7f16\u8f91\u3001\u628a query \u91cc\u7684\u6307\u6807\u540d\u6362\u6210\u7b2c\u4e09\u8282\u635e\u51fa\u6765\u7684\u771f\u5b9e\u540d\u5b57\u3002<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u2b50 \u544a\u8b66\u89c4\u5219&#xff1a;\u4ece\u53cd\u6a21\u5f0f\u53cd\u63a8&#xff0c;\u800c\u4e0d\u662f\u4ece\u6307\u6807\u6b63\u63a8<\/h3>\n<p>\u7f51\u4e0a\u80fd\u641c\u5230\u7684 Jenkins \u544a\u8b66\u89c4\u5219&#xff0c;\u57fa\u672c\u505c\u5728\u4e24\u6761&#xff1a;\u5b9e\u4f8b\u6302\u4e86\u3001\u961f\u5217\u957f\u4e86\u3002\u56e0\u4e3a\u5b83\u4eec\u662f\u770b\u7740\u6307\u6807\u5217\u8868\u5199\u51fa\u6765\u7684\u2014\u2014\u6709\u4ec0\u4e48\u6307\u6807&#xff0c;\u5c31\u62a5\u4ec0\u4e48\u3002<\/p>\n<p>\u6211\u6362\u4e86\u4e2a\u65b9\u5411&#xff1a;\u5148\u60f3\u300cJenkinsfile \u5199\u9519\u4f1a\u9020\u6210\u4ec0\u4e48\u540e\u679c\u300d&#xff0c;\u518d\u53bb\u627e\u54ea\u4e2a\u6307\u6807\u80fd\u7167\u51fa\u8fd9\u4e2a\u540e\u679c\u3002<\/p>\n<p>\u8fd9\u5957\u63a8\u5bfc\u7ebf\u7d22\u6765\u81ea\u300aJenkinsfile \u53cd\u6a21\u5f0f\u56fe\u9274\u300b\u90a3 17 \u6761&#xff1a;<\/p>\n<table>\n<tr>\u53cd\u6a21\u5f0f\u5b83\u5728\u76d1\u63a7\u4e0a\u957f\u4ec0\u4e48\u6837\u5bf9\u5e94\u89c4\u5219<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">input \u5360\u7740 executor \u7b49\u4eba\u5ba1\u6279<\/td>\n<td align=\"left\">\u2b50 executor \u5360\u6ee1&#xff0c;\u53ef\u673a\u5668 CPU \u662f\u7a7a\u7684<\/td>\n<td align=\"left\">\u6267\u884c\u5668\u957f\u671f\u5360\u6ee1<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u5931\u8d25\u81ea\u52a8\u65e0\u754c\u91cd\u8bd5<\/td>\n<td align=\"left\">\u77ed\u65f6\u95f4\u5237\u51fa\u5927\u91cf\u6784\u5efa&#xff0c;\u6bcf\u6b21\u90fd\u5931\u8d25<\/td>\n<td align=\"left\">\u6784\u5efa\u901f\u7387\u5f02\u5e38\u7a81\u589e<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">poll \u6ca1\u8bbe\u8d85\u65f6\u4e0a\u9650<\/td>\n<td align=\"left\">\u5355\u4e2a\u6784\u5efa\u6c38\u4e0d\u9000\u51fa<\/td>\n<td align=\"left\">\u6784\u5efa\u8fd0\u884c\u8d85\u65f6<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Groovy \u91cd\u903b\u8f91\u8dd1\u5728 controller<\/td>\n<td align=\"left\">controller \u5806\u5185\u5b58\u6301\u7eed\u722c\u5347<\/td>\n<td align=\"left\">\u5806\u5185\u5b58\u4f7f\u7528\u7387\u8fc7\u9ad8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7b2c\u4e00\u6761\u6700\u53cd\u76f4\u89c9&#xff0c;\u4e5f\u6700\u503c\u94b1&#xff1a;\u76d1\u63a7\u9762\u677f\u4e0a executor \u4f7f\u7528\u7387 100%\u3001\u770b\u7740\u4e00\u7247\u7e41\u5fd9&#xff0c;\u5b9e\u9645\u4e00\u53f0\u673a\u5668\u90fd\u6ca1\u5728\u5e72\u6d3b\u2014\u2014\u5168\u5361\u5728\u7b49\u4eba\u70b9\u300c\u786e\u8ba4\u53d1\u5e03\u300d\u3002<\/p>\n<h4>5.1 \u5b8c\u6574\u7684 jenkins-rules.yml<\/h4>\n<p>\u76f4\u63a5\u6284\u8d70\u3002\u6bcf\u6761\u90fd\u5728\u771f\u5b9e Prometheus \u4e0a\u8dd1\u8fc7&#xff08;\u600e\u4e48\u8dd1\u89c1\u4e0b\u4e00\u8282&#xff09;&#xff1a;<\/p>\n<p><span class=\"token comment\"># Jenkins \u76d1\u63a7\u544a\u8b66\u89c4\u5219&#xff08;jenkinsci\/prometheus-plugin&#xff09;<\/span><br \/>\n<span class=\"token comment\"># \u26a0\ufe0f \u6307\u6807\u540d\u8bf7\u5148\u6309\u7b2c\u4e09\u8282\u81ea\u5df1\u635e\u4e00\u904d\u786e\u8ba4&#xff0c;\u524d\u7f00\u53ef\u914d\u7f6e<\/span><br \/>\n<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> jenkins<span class=\"token punctuation\">&#8211;<\/span>alerts<br \/>\n    <span class=\"token key atrule\">rules<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token comment\"># \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u53ef\u7528\u6027 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u670d\u52a1\u4e0d\u53ef\u7528<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> up<span class=\"token punctuation\">{<\/span>job&#061;&#034;jenkins&#034;<span class=\"token punctuation\">}<\/span> &#061;&#061; 0<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 1m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> critical<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u670d\u52a1\u4e0d\u53ef\u7528&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;Jenkins {{ $labels.instance }} \u5df2\u505c\u6b62\u54cd\u5e94&#xff0c;\u6240\u6709\u53d1\u5e03\u4e2d\u65ad&#034;<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u8282\u70b9\u79bb\u7ebf<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> jenkins_node_offline_value <span class=\"token punctuation\">&gt;<\/span> 0<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> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u6709\u8282\u70b9\u79bb\u7ebf&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u5f53\u524d\u79bb\u7ebf\u8282\u70b9\u6570 {{ $value }}&#xff0c;\u6784\u5efa\u80fd\u529b\u4e0b\u964d&#034;<\/span><\/p>\n<p>      <span class=\"token comment\"># \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u961f\u5217&#xff1a;\u6ca1\u4eba\u80fd\u53d1\u7248 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u6784\u5efa\u961f\u5217\u5806\u79ef<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> jenkins_queue_size_value <span class=\"token punctuation\">&gt;<\/span> 5<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> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u6784\u5efa\u961f\u5217\u6301\u7eed\u5806\u79ef&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u961f\u5217\u957f\u5ea6 {{ $value }} \u5df2\u6301\u7eed 10 \u5206\u949f\u2014\u2014\u5148\u770b executor \u662f\u4e0d\u662f\u88ab\u5360\u6ee1\u4e86&#034;<\/span><\/p>\n<p>      <span class=\"token comment\"># Jenkins \u81ea\u5df1\u5224\u5b9a\u4e3a\u300c\u5361\u4f4f\u300d\u7684\u961f\u5217\u9879&#xff08;\u7b49\u5f85\u8fdc\u8d85\u540c\u7c7b\u4efb\u52a1\u7684\u6b63\u5e38\u6c34\u5e73&#xff09;<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u961f\u5217\u51fa\u73b0\u5361\u6b7b\u4efb\u52a1<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> jenkins_queue_stuck_value <span class=\"token punctuation\">&gt;<\/span> 0<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 15m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u961f\u5217\u4e2d\u6709\u4efb\u52a1\u5361\u6b7b&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u5361\u6b7b\u4efb\u52a1\u6570 {{ $value }}\u3002\u5e38\u89c1\u539f\u56e0&#xff1a;\u6807\u7b7e\u6ca1\u6709\u5339\u914d\u7684\u5728\u7ebf\u8282\u70b9\u3001\u6216\u6240\u9700\u8d44\u6e90\u88ab\u957f\u671f\u5360\u7528&#034;<\/span><\/p>\n<p>      <span class=\"token comment\"># \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2b50 executor&#xff1a;\u5360\u7740\u4e0d\u653e \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u6267\u884c\u5668\u957f\u671f\u5360\u6ee1<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> jenkins_executor_free_value &#061;&#061; 0 and jenkins_executor_count_value <span class=\"token punctuation\">&gt;<\/span> 0<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 30m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u6267\u884c\u5668\u5df2\u5360\u6ee1 30 \u5206\u949f&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u7a7a\u95f2\u6267\u884c\u5668\u4e3a 0\u3002\u82e5\u540c\u671f\u673a\u5668 CPU \u5f88\u4f4e&#xff0c;\u516b\u6210\u662f\u6709\u6784\u5efa\u5361\u5728 input \u5ba1\u6279&#xff0c;\u5360\u7740\u53f7\u724c\u4e0d\u5e72\u6d3b&#034;<\/span><\/p>\n<p>      <span class=\"token comment\"># \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2b50 \u6784\u5efa&#xff1a;\u6c38\u4e0d\u9000\u51fa \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<\/span><br \/>\n      <span class=\"token comment\"># \u26a0\ufe0f \u8fd9\u6761\u7684 description \u662f\u88ab\u5b9e\u6218\u6539\u8fc7\u4e00\u7248\u7684&#xff1a;\u539f\u6765\u53ea\u5199\u300c\u9700\u624b\u52a8 abort\u300d&#xff0c;<\/span><br \/>\n      <span class=\"token comment\">#    \u7ed3\u679c\u771f\u51fa\u4e8b\u65f6&#xff0c;\u4efb\u52a1\u5217\u8868\u91cc\u6839\u672c\u627e\u4e0d\u5230\u90a3\u4e2a\u6784\u5efa\u3001abort \u6309\u94ae\u70b9\u4e86\u4e5f\u6ca1\u53cd\u5e94\u3002<\/span><br \/>\n      <span class=\"token comment\">#    \u7ecf\u8fc7\u89c1\u59ca\u59b9\u7bc7&#xff0c;\u8fd9\u91cc\u76f4\u63a5\u7ed9\u6539\u540e\u7684\u7248\u672c\u3002<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u6784\u5efa\u8fd0\u884c\u8d85\u65f6<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> default_jenkins_builds_running_build_duration_milliseconds \/ 1000 \/ 3600 <span class=\"token punctuation\">&gt;<\/span> 2<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> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u6784\u5efa\u8fd0\u884c\u8d85\u8fc7 2 \u5c0f\u65f6&#034;<\/span><br \/>\n          <span class=\"token comment\"># \u26a0\ufe0f \u884c\u5c3e\u53cd\u659c\u6760 &#061; YAML \u8f6c\u4e49\u6362\u884c&#xff0c;\u6298\u884c\u540e\u4e0d\u4f1a\u63d2\u5165\u7a7a\u683c\u3002<\/span><br \/>\n          <span class=\"token comment\">#    \u4e0d\u52a0\u7684\u8bdd&#xff0c;\u6e32\u67d3\u51fa\u6765\u4f1a\u53d8\u6210\u300c\u2026\u5c0f\u65f6\u3002 \u82e5 executor\u2026\u300d\u2014\u2014\u4e2d\u6587\u91cc\u591a\u4e00\u4e2a\u534a\u89d2\u7a7a\u683c<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> &#034;\u4efb\u52a1 <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> $labels.jenkins_job <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span> \u5df2\u8fd0\u884c <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> printf \\\\&#034;%.1f\\\\&#034; $value <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span> \u5c0f\u65f6\u3002\\\\<br \/>\n                        \u82e5 executor \u672a\u88ab\u5360\u7528&#xff0c;\u591a\u534a\u662f\u6ca1\u6536\u5e72\u51c0\u7684\u6b8b\u7559\u6784\u5efa&#xff1b;\u4efb\u52a1\u5217\u8868\u91cc\u901a\u5e38\u627e\u4e0d\u5230\u5b83&#xff0c;\\\\<br \/>\n                        \u53bb groupId<span class=\"token punctuation\">:<\/span>artifactId \u5bf9\u5e94\u7684\u6a21\u5757\u9875\u770b\u6784\u5efa\u5386\u53f2\u3002\\\\<br \/>\n                        \u82e5 abort \u6309\u94ae\u65e0\u6548&#xff08;executor \u4e3a null&#xff09;&#xff0c;\u8d70 Script Console \u628a Run \u7684 state \u53cd\u5c04\u6539\u6210 COMPLETED&#xff08;finish() \u662f protected&#xff0c;\u8c03\u4e0d\u52a8&#xff09;&#034;<\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u6784\u5efa\u6392\u961f\u7b49\u5f85\u8fc7\u4e45<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> default_jenkins_builds_last_build_waiting_milliseconds \/ 1000 \/ 60 <span class=\"token punctuation\">&gt;<\/span> 30<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> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u6784\u5efa\u6392\u961f\u7b49\u5f85\u8fc7\u4e45&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u4efb\u52a1 {{ $labels.jenkins_job }} \u4e0a\u6b21\u6784\u5efa\u5728\u961f\u5217\u91cc\u7b49\u4e86 {{ printf \\\\&#034;%.0f\\\\&#034; $value }} \u5206\u949f\u624d\u5f00\u59cb&#034;<\/span><\/p>\n<p>      <span class=\"token comment\"># \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2b50 \u91cd\u8bd5\u96ea\u5d29 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u6784\u5efa\u901f\u7387\u5f02\u5e38\u7a81\u589e<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> sum(rate(default_jenkins_builds_total_build_count_total<span class=\"token punctuation\">[<\/span>5m<span class=\"token punctuation\">]<\/span>)) by (jenkins_job) * 300 <span class=\"token punctuation\">&gt;<\/span> 10<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> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u4efb\u52a1\u6784\u5efa\u9891\u7387\u5f02\u5e38&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u4efb\u52a1 {{ $labels.jenkins_job }} \u8fd1 5 \u5206\u949f\u89e6\u53d1\u7ea6 {{ printf \\\\&#034;%.0f\\\\&#034; $value }} \u6b21\u6784\u5efa&#xff0c;\u68c0\u67e5\u662f\u5426\u5b58\u5728\u65e0\u754c\u81ea\u52a8\u91cd\u8bd5&#034;<\/span><\/p>\n<p>      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u4efb\u52a1\u8fde\u7eed\u5931\u8d25<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> increase(default_jenkins_builds_failed_build_count_total<span class=\"token punctuation\">[<\/span>1h<span class=\"token punctuation\">]<\/span>) <span class=\"token punctuation\">&gt;<\/span>&#061; 3<br \/>\n        <span class=\"token key atrule\">for<\/span><span class=\"token punctuation\">:<\/span> 1m<br \/>\n        <span class=\"token key atrule\">labels<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u4efb\u52a1 1 \u5c0f\u65f6\u5185\u5931\u8d25\u591a\u6b21&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u4efb\u52a1 {{ $labels.jenkins_job }} \u8fd1 1 \u5c0f\u65f6\u5931\u8d25 {{ printf \\\\&#034;%.0f\\\\&#034; $value }} \u6b21&#xff0c;\u591a\u4e3a\u914d\u7f6e\u9519\u800c\u975e\u5076\u53d1&#xff0c;\u91cd\u8bd5\u89e3\u51b3\u4e0d\u4e86&#034;<\/span><\/p>\n<p>      <span class=\"token comment\"># \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2b50 controller \u88ab\u62d6\u57ae \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u5806\u5185\u5b58\u4f7f\u7528\u7387\u8fc7\u9ad8<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> jvm_memory_bytes_used<span class=\"token punctuation\">{<\/span>area&#061;&#034;heap&#034;<span class=\"token punctuation\">,<\/span> job&#061;&#034;jenkins&#034;<span class=\"token punctuation\">}<\/span> \/ jvm_memory_bytes_max<span class=\"token punctuation\">{<\/span>area&#061;&#034;heap&#034;<span class=\"token punctuation\">,<\/span> job&#061;&#034;jenkins&#034;<span class=\"token punctuation\">}<\/span> <span class=\"token punctuation\">&gt;<\/span> 0.85<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> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> warning<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins controller \u5806\u5185\u5b58\u4f7f\u7528\u7387\u8d85\u8fc7 85%&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u5f53\u524d {{ $value | humanizePercentage }}\u3002\u6392\u67e5\u662f\u5426\u6709\u6d41\u6c34\u7ebf\u5728 Groovy \u91cc\u89e3\u6790\u5927 JSON \/ \u8bfb\u5927\u65e5\u5fd7\u2014\u2014Groovy \u5168\u90e8\u8dd1\u5728 controller \u4e0a&#034;<\/span><\/p>\n<p>      <span class=\"token comment\"># \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u63d2\u4ef6\u5065\u5eb7 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">alert<\/span><span class=\"token punctuation\">:<\/span> Jenkins\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25<br \/>\n        <span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> jenkins_plugins_failed <span class=\"token punctuation\">&gt;<\/span> 0<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> <span class=\"token punctuation\">{<\/span> <span class=\"token key atrule\">severity<\/span><span class=\"token punctuation\">:<\/span> critical<span class=\"token punctuation\">,<\/span> <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> jenkins <span class=\"token punctuation\">}<\/span><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;Jenkins \u6709\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25&#034;<\/span><br \/>\n          <span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u5931\u8d25\u63d2\u4ef6\u6570 {{ $value }}\u3002\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25\u4f1a\u8ba9\u4f9d\u8d56\u5b83\u7684 step \u5728\u6d41\u6c34\u7ebf\u91cc\u76f4\u63a5\u62a5 NoSuchMethodError&#034;<\/span><\/p>\n<h4>5.2 \u4e09\u4e2a\u9608\u503c\u600e\u4e48\u5b9a\u7684&#xff08;\u522b\u7167\u6284\u6570\u5b57&#xff0c;\u7167\u6284\u601d\u8def&#xff09;<\/h4>\n<table>\n<tr>\u89c4\u5219\u6211\u7ed9\u7684\u503c\u4f9d\u636e<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u961f\u5217\u5806\u79ef &gt; 5<\/td>\n<td align=\"left\">5<\/td>\n<td align=\"left\">\u6211\u8fd9\u53f0\u53ea\u6709 2 \u4e2a executor&#xff0c;\u961f\u5217\u5230 5 \u5c31\u662f\u6392\u4e86\u4e24\u8f6e\u4ee5\u4e0a\u3002executor \u591a\u7684\u673a\u5668\u8981\u5f80\u4e0a\u8c03<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6784\u5efa\u8d85\u65f6 &gt; 2h<\/td>\n<td align=\"left\">2 \u5c0f\u65f6<\/td>\n<td align=\"left\">\u6b63\u5e38\u6784\u5efa\u662f\u5206\u949f\u7ea7&#xff0c;2h \u662f\u4fdd\u5b88\u503c\u3002\u5148\u6309\u4f60\u6700\u6162\u7684\u90a3\u4e2a job \u7684 3 \u500d\u8d77\u6b65<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6267\u884c\u5668\u5360\u6ee1 for: 30m<\/td>\n<td align=\"left\">30 \u5206\u949f<\/td>\n<td align=\"left\">\u77ed\u65f6\u5360\u6ee1\u662f\u6b63\u5e38\u7e41\u5fd9&#xff0c;\u6301\u7eed\u534a\u5c0f\u65f6\u624d\u53ef\u7591<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6240\u6709\u9608\u503c\u90fd\u662f\u300c\u6309\u81ea\u5df1\u73af\u5883\u91cf\u4e00\u904d\u518d\u5b9a\u300d&#xff0c;\u76f4\u63a5\u6284\u6211\u7684\u6570\u5b57\u5927\u6982\u7387\u4e0d\u5408\u9002\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u2b50 \u96f6\u544a\u8b66\u4e0d\u7b49\u4e8e\u6ca1\u95ee\u9898&#xff1a;\u600e\u4e48\u9a8c\u8bc1\u89c4\u5219\u4e0d\u662f\u54d1\u5f39<\/h3>\n<p>\u8fd9\u4e00\u8282\u662f\u6211\u8ba4\u4e3a\u6700\u8be5\u8bb2\u3001\u800c\u51e0\u4e4e\u6ca1\u4eba\u8bb2\u7684\u90e8\u5206\u3002<\/p>\n<p>\u89c4\u5219\u5199\u5b8c\u52a0\u8f7d\u4e0a\u53bb&#xff0c;\u9875\u9762\u4e0a\u4e00\u7247\u7eff&#xff0c;\u4f60\u4f1a\u677e\u4e00\u53e3\u6c14\u3002\u4f46\u300c\u6ca1\u6709\u544a\u8b66\u300d\u6709\u4e24\u79cd\u622a\u7136\u4e0d\u540c\u7684\u542b\u4e49&#xff1a;<\/p>\n<table>\n<tr>\u771f\u5b9e\u542b\u4e49\u4f60\u770b\u5230\u7684<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u786e\u5b9e\u6ca1\u95ee\u9898<\/td>\n<td align=\"left\">\u4e00\u7247\u7eff \u2705<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6307\u6807\u540d\u5199\u9519 \/ \u6807\u7b7e\u9009\u62e9\u5668\u4e0d\u5339\u914d&#xff0c;\u8868\u8fbe\u5f0f\u6c38\u8fdc\u8fd4\u56de\u7a7a<\/td>\n<td align=\"left\">\u4e5f\u662f\u4e00\u7247\u7eff \u274c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u540e\u8005\u5c31\u662f\u4e00\u9897\u54d1\u5f39\u3002\u800c\u4e14\u5b83\u6bd4\u6ca1\u6709\u89c4\u5219\u66f4\u7cdf\u2014\u2014\u6ca1\u89c4\u5219\u4f60\u77e5\u9053\u81ea\u5df1\u5728\u88f8\u5954&#xff0c;\u6709\u4e86\u8fd9\u9897\u54d1\u5f39\u4f60\u4ee5\u4e3a\u81ea\u5df1\u5b89\u5168\u4e86\u3002<\/p>\n<p>\u8fd9\u548c\u6211\u5728\u53cd\u6a21\u5f0f\u56fe\u9274\u91cc\u5199\u7684\u662f\u540c\u4e00\u4ef6\u4e8b&#xff1a;\u4e00\u9053 fail-open \u7684\u68c0\u67e5&#xff0c;\u6bd4\u6ca1\u6709\u68c0\u67e5\u66f4\u7cdf\u3002 \u53ea\u4e0d\u8fc7\u90a3\u6b21\u8bf4\u7684\u662f\u6d41\u6c34\u7ebf\u91cc\u7684\u5224\u636e&#xff0c;\u8fd9\u6b21\u662f\u544a\u8b66\u89c4\u5219\u672c\u8eab\u3002<\/p>\n<p>\u9a8c\u8bc1\u65b9\u6cd5&#xff1a;\u628a\u6bcf\u6761 expr \u76f4\u63a5\u6253\u5230 Prometheus \u7684\u67e5\u8be2\u63a5\u53e3\u4e0a&#xff0c;\u770b\u5b83\u5230\u5e95\u80fd\u4e0d\u80fd\u53d6\u5230\u6570\u3002<\/p>\n<p><span class=\"token assign-left variable\">PROM<\/span><span class=\"token operator\">&#061;<\/span>http:\/\/prometheus.example.com:9090<\/p>\n<p><span class=\"token comment\"># \u2460 \u5148\u9a8c\u8bed\u6cd5 &#043; \u80fd\u5426\u53d6\u6570<\/span><br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-s<\/span> <span class=\"token parameter variable\">&#8211;get<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$PROM<\/span>\/api\/v1\/query&#034;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;data-urlencode <span class=\"token string\">&#039;query&#061;jenkins_queue_size_value &gt; 5&#039;<\/span><\/p>\n<p><span class=\"token comment\"># \u2461 \u2b50 \u5173\u952e\u4e00\u6b65&#xff1a;\u628a\u9608\u503c\u53bb\u6389&#xff0c;\u9a8c\u300c\u88f8\u6307\u6807\u300d\u6709\u6ca1\u6709\u6570\u636e<\/span><br \/>\n<span class=\"token comment\">#    \u2460\u8fd4\u56de\u7a7a &#043; \u2461\u4e5f\u8fd4\u56de\u7a7a &#061; \u6307\u6807\u540d\u6216\u6807\u7b7e\u5199\u9519\u4e86&#xff0c;\u8fd9\u6761\u89c4\u5219\u662f\u54d1\u5f39<\/span><br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-s<\/span> <span class=\"token parameter variable\">&#8211;get<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$PROM<\/span>\/api\/v1\/query&#034;<\/span> <span class=\"token punctuation\">\\\\<\/span><br \/>\n  &#8211;data-urlencode <span class=\"token string\">&#039;query&#061;jenkins_queue_size_value&#039;<\/span><\/p>\n<p>\u5224\u636e\u5f88\u7b80\u5355&#xff1a;\u5e26\u9608\u503c\u7684\u67e5\u8be2\u8fd4\u56de\u7a7a\u4e0d\u80fd\u8bf4\u660e\u6ca1\u95ee\u9898&#xff1b;\u5fc5\u987b\u628a\u53bb\u6389\u9608\u503c\u7684\u88f8\u6307\u6807\u4e5f\u67e5\u4e00\u904d&#xff0c;\u786e\u8ba4\u5b83\u771f\u7684\u6709\u6570\u636e\u70b9\u3002<\/p>\n<p>\u6211\u8fd9 11 \u6761\u5c31\u662f\u8fd9\u4e48\u8fc7\u7684\u4e00\u904d&#xff1a;<\/p>\n<p>\u2705 Jenkins\u670d\u52a1\u4e0d\u53ef\u7528          \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u8282\u70b9\u79bb\u7ebf            \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u6784\u5efa\u961f\u5217\u5806\u79ef        \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u961f\u5217\u51fa\u73b0\u5361\u6b7b\u4efb\u52a1    \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u6267\u884c\u5668\u957f\u671f\u5360\u6ee1      \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u6784\u5efa\u8fd0\u884c\u8d85\u65f6        \u2192 \u5f53\u524d\u547d\u4e2d 1 \u6761   \u2190 \u5c31\u662f\u5f00\u5934\u90a3\u6761<br \/>\n\u2705 Jenkins\u6784\u5efa\u6392\u961f\u7b49\u5f85\u8fc7\u4e45    \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u6784\u5efa\u901f\u7387\u5f02\u5e38\u7a81\u589e    \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u4efb\u52a1\u8fde\u7eed\u5931\u8d25        \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u5806\u5185\u5b58\u4f7f\u7528\u7387\u8fc7\u9ad8    \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<br \/>\n\u2705 Jenkins\u63d2\u4ef6\u52a0\u8f7d\u5931\u8d25        \u2192 \u5f53\u524d\u547d\u4e2d 0 \u6761<\/p>\n<p>\u90a3 10 \u4e2a 0 \u6211\u90fd\u56de\u5934\u9a8c\u4e86\u88f8\u6307\u6807\u3002\u4e3e\u4e2a\u4f8b\u5b50\u2014\u2014\u5806\u5185\u5b58\u90a3\u6761\u7528\u4e86 job&#061;&#034;jenkins&#034; \u8fd9\u4e2a\u9009\u62e9\u5668&#xff0c;\u4e07\u4e00 Prometheus \u90a3\u8fb9 job \u540d\u4e0d\u53eb\u8fd9\u4e2a&#xff0c;\u5b83\u5c31\u6c38\u8fdc\u4e0d\u4f1a\u89e6\u53d1&#xff1a;<\/p>\n<p>$ <span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-s<\/span> <span class=\"token parameter variable\">&#8211;get<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$PROM<\/span>\/api\/v1\/query&#034;<\/span> &#8211;data-urlencode <span class=\"token string\">&#039;query&#061;jvm_memory_bytes_used{area&#061;&#034;heap&#034;, job&#061;&#034;jenkins&#034;}&#039;<\/span><br \/>\n<span class=\"token comment\"># \u2192 \u6709\u6570\u636e&#xff0c;430742352 \u5b57\u8282<\/span><\/p>\n<p>\u6709\u6570\u3002\u6240\u4ee5\u5b83\u7684 0 \u662f\u300c\u5806\u7528\u4e86 2.6%&#xff0c;\u786e\u5b9e\u6ca1\u95ee\u9898\u300d&#xff0c;\u4e0d\u662f\u300c\u9009\u62e9\u5668\u5199\u9519\u4e86\u300d\u3002\u8fd9\u4e00\u6b65\u82b1\u4e0d\u4e86\u4e24\u5206\u949f&#xff0c;\u4f46\u5b83\u51b3\u5b9a\u4f60\u8fd9\u5957\u544a\u8b66\u662f\u771f\u7684\u8fd8\u662f\u6446\u8bbe\u3002<\/p>\n<h4>6.1 \u26a0\ufe0f \u8868\u8fbe\u5f0f\u9a8c\u8fc7&#xff0c;\u4e0d\u7b49\u4e8e\u89c4\u5219\u80fd\u52a0\u8f7d\u2014\u2014\u6211\u5728\u8fd9\u683d\u4e86\u4e00\u6b21<\/h4>\n<p>\u4e0a\u9762\u8fd9\u5957 api\/v1\/query \u9a8c\u8bc1\u6709\u4e2a\u76f2\u533a&#xff0c;\u5927\u5230\u80fd\u8ba9\u6574\u4e2a Prometheus \u8d77\u4e0d\u6765\u3002\u6211\u662f\u628a\u6587\u4ef6\u653e\u4e0a\u53bb\u3001\u91cd\u542f&#xff0c;\u5b83\u6ca1\u8d77\u6765\u624d\u53d1\u73b0\u7684&#xff1a;<\/p>\n<p>level&#061;ERROR msg&#061;&#034;Error loading rule file patterns from config&#034;<br \/>\n  err&#061;&#034;parse rules from file \\\\&#034;\/prometheus\/rules\/jenkins-rules.yml\\\\&#034;:<br \/>\n       group \\\\&#034;jenkins-alerts\\\\&#034;, rule 6, \\\\&#034;Jenkins\u6784\u5efa\u8fd0\u884c\u8d85\u65f6\\\\&#034;:<br \/>\n       annotation \\\\&#034;description\\\\&#034;: template: function \\\\&#034;div\\\\&#034; not defined&#034;<\/p>\n<p>\u539f\u56e0\u5f88\u4f4e\u7ea7&#xff1a;\u6211\u5728 annotation \u91cc\u5199\u4e86 {{ printf &#034;%.1f&#034; (div $value 3600000) }}&#xff0c;\u60f3\u628a\u6beb\u79d2\u6362\u7b97\u6210\u5c0f\u65f6\u3002\u4f46 div \/ mul \u4e0d\u662f Prometheus \u7684\u6a21\u677f\u51fd\u6570\u2014\u2014\u90a3\u662f Grafana \u90a3\u5957\u3002Prometheus \u7684\u544a\u8b66\u6a21\u677f\u8d70 Go text\/template&#xff0c;\u53ef\u7528\u7684\u662f humanize \/ humanizePercentage \/ humanizeDuration \/ printf \/ query \u8fd9\u4e9b\u3002<\/p>\n<p>\u4e24\u4e2a\u6559\u8bad&#xff0c;\u7b2c\u4e8c\u4e2a\u66f4\u8981\u547d&#xff1a;<\/p>\n<p>\u2460 api\/v1\/query \u53ea\u8dd1 expr&#xff0c;\u6839\u672c\u4e0d\u78b0 annotation\u3002 \u6240\u4ee5\u6a21\u677f\u91cc\u7684\u9519&#xff0c;\u524d\u9762\u90a3\u5957\u9a8c\u8bc1\u4e00\u4e2a\u90fd\u7167\u4e0d\u51fa\u6765\u3002expr \u9a8c\u8fc7 \u2260 \u89c4\u5219\u6587\u4ef6\u80fd\u52a0\u8f7d\u3002<\/p>\n<p>\u2461 \u2b50 \u4e00\u4e2a\u89c4\u5219\u6587\u4ef6\u5199\u9519&#xff0c;\u6574\u4e2a Prometheus \u8d77\u4e0d\u6765\u2014\u2014\u4e0d\u662f\u53ea\u6709\u90a3\u6761\u89c4\u5219\u5931\u6548\u3002 \u8fd9\u70b9\u5f88\u591a\u4eba\u6ca1\u610f\u8bc6\u5230&#xff1a;\u5b83\u4e0d\u662f\u300c\u8df3\u8fc7\u574f\u89c4\u5219\u3001\u5176\u4f59\u7167\u5e38\u300d&#xff0c;\u662f\u62d2\u7edd\u542f\u52a8\u3002\u4f60\u4ee5\u4e3a\u5728\u7ed9\u76d1\u63a7\u52a0\u4e1c\u897f&#xff0c;\u5b9e\u9645\u662f\u628a\u6574\u5957\u76d1\u63a7\u505c\u4e86\u3002<\/p>\n<p>\u21d2 \u6240\u4ee5\u89c4\u5219\u6587\u4ef6\u5fc5\u987b\u5148\u79bb\u7ebf\u6821\u9a8c\u518d\u4e0a\u7ebf&#xff1a;<\/p>\n<p><span class=\"token comment\"># promtool \u662f Prometheus \u81ea\u5e26\u7684&#xff0c;\u5bb9\u5668\u91cc\u5c31\u6709<\/span><br \/>\npromtool check rules jenkins-rules.yml<\/p>\n<p><span class=\"token comment\"># \u6ca1\u88c5\u672c\u5730\u4e8c\u8fdb\u5236\u5c31\u501f\u5bb9\u5668\u8dd1<\/span><br \/>\n<span class=\"token comment\"># \u26a0\ufe0f \u5fc5\u987b &#8211;entrypoint promtool&#xff1a;prom\/prometheus \u955c\u50cf\u7684 ENTRYPOINT \u662f \/bin\/prometheus&#xff0c;<\/span><br \/>\n<span class=\"token comment\">#    \u76f4\u63a5\u628a promtool \u5f53\u53c2\u6570\u4f20\u4f1a\u62a5 &#034;unexpected promtool&#034;<\/span><br \/>\n<span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">&#8211;rm<\/span> <span class=\"token parameter variable\">-v<\/span> <span class=\"token string\">&#034;<span class=\"token environment constant\">$PWD<\/span>:\/r&#034;<\/span> <span class=\"token parameter variable\">&#8211;entrypoint<\/span> promtool <span class=\"token punctuation\">\\\\<\/span><br \/>\n  prom\/prometheus:latest check rules \/r\/jenkins-rules.yml<\/p>\n<p>promtool \u4f1a\u540c\u65f6\u6821\u9a8c\u8868\u8fbe\u5f0f\u8bed\u6cd5\u548c annotation \u6a21\u677f&#xff0c;\u6b63\u662f api\/v1\/query \u8986\u76d6\u4e0d\u5230\u7684\u90a3\u534a\u8fb9\u3002<\/p>\n<p>\u6362\u7b97\u600e\u4e48\u5199\u624d\u5bf9&#xff1a;\u628a\u5355\u4f4d\u6362\u7b97\u653e\u8fdb expr&#xff0c;\u8ba9 $value \u672c\u8eab\u5c31\u662f\u4f60\u8981\u7684\u5355\u4f4d&#xff1b;\u6bd4\u4f8b\u7528 humanizePercentage\u3002\u4e0a\u9762\u7b2c 5.1 \u8282\u7684\u89c4\u5219\u5df2\u7ecf\u662f\u4fee\u6b63\u540e\u7684\u5199\u6cd5&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u274c \u9519&#xff1a;\u6a21\u677f\u91cc\u505a\u7b97\u672f<\/span><br \/>\n<span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> xxx_milliseconds <span class=\"token punctuation\">&gt;<\/span> 2 * 60 * 60 * 1000<br \/>\n<span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u5df2\u8fd0\u884c {{ printf \\\\&#034;%.1f\\\\&#034; (div $value 3600000) }} \u5c0f\u65f6&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u2705 \u5bf9&#xff1a;\u7b97\u672f\u653e expr&#xff0c;\u6a21\u677f\u53ea\u8d1f\u8d23\u683c\u5f0f\u5316<\/span><br \/>\n<span class=\"token key atrule\">expr<\/span><span class=\"token punctuation\">:<\/span> xxx_milliseconds \/ 1000 \/ 3600 <span class=\"token punctuation\">&gt;<\/span> 2<br \/>\n<span class=\"token key atrule\">description<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#034;\u5df2\u8fd0\u884c {{ printf \\\\&#034;%.1f\\\\&#034; $value }} \u5c0f\u65f6&#034;<\/span><\/p>\n<p>&#x1f4a1; \u987a\u5e26\u4e00\u4e2a\u4e2d\u6587\u7279\u6709\u7684\u5c0f\u5751&#xff1a;description \u5199\u957f\u4e86\u8981\u6298\u884c\u65f6&#xff0c;\u884c\u5c3e\u8bb0\u5f97\u52a0\u53cd\u659c\u6760\u3002YAML \u7684\u666e\u901a\u6298\u884c\u4f1a\u628a\u6362\u884c\u53d8\u6210\u4e00\u4e2a\u7a7a\u683c&#xff0c;\u82f1\u6587\u91cc\u6b63\u597d&#xff0c;\u4e2d\u6587\u91cc\u5c31\u4f1a\u6e32\u67d3\u6210\u300c\u2026\u5c0f\u65f6\u3002 \u82e5 executor\u2026\u300d\u2014\u2014\u53e5\u53f7\u540e\u9762\u51ed\u7a7a\u591a\u534a\u4e2a\u7a7a\u683c\u3002\u884c\u5c3e \\\\ \u662f\u8f6c\u4e49\u6362\u884c&#xff0c;\u6298\u5b8c\u4e0d\u63d2\u7a7a\u683c\u3002\u7b2c 5.1 \u8282\u90a3\u6761\u89c4\u5219\u91cc\u5c31\u662f\u8fd9\u4e48\u5199\u7684\u3002<\/p>\n<h4>6.2 \u52a0\u8f7d\u89c4\u5219<\/h4>\n<p><span class=\"token comment\"># \u653e\u8fdb Prometheus \u7684\u89c4\u5219\u76ee\u5f55&#xff08;rule_files \u901a\u5e38\u914d\u7684\u662f\u901a\u914d&#xff0c;\u4e0d\u7528\u6539\u4e3b\u914d\u7f6e&#xff09;<\/span><br \/>\n<span class=\"token function\">cp<\/span> jenkins-rules.yml \/path\/to\/prometheus\/rules\/<\/p>\n<p><span class=\"token comment\"># \u70ed\u52a0\u8f7d&#xff08;\u9700 Prometheus \u542f\u52a8\u65f6\u5e26 &#8211;web.enable-lifecycle&#xff09;<\/span><br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-X<\/span> POST <span class=\"token variable\">$PROM<\/span>\/-\/reload<\/p>\n<p><span class=\"token comment\"># \u2b50 \u786e\u8ba4\u771f\u7684\u52a0\u8f7d\u8fdb\u53bb\u4e86&#xff0c;\u522b\u53ea\u770b reload \u8fd4\u56de 200<\/span><br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-s<\/span> <span class=\"token variable\">$PROM<\/span>\/api\/v1\/rules <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-o<\/span> <span class=\"token string\">&#039;jenkins-alerts&#039;<\/span><\/p>\n<p>\u6700\u540e\u90a3\u884c\u540c\u6837\u662f\u300c\u522b\u8ba9\u5b83\u53d8\u6210\u54d1\u5f39\u300d\u7684\u4e00\u90e8\u5206&#xff1a;reload \u6210\u529f \u2260 \u4f60\u7684\u89c4\u5219\u7ec4\u88ab\u52a0\u8f7d\u4e86&#xff08;\u6587\u4ef6\u653e\u9519\u76ee\u5f55\u3001\u901a\u914d\u6ca1\u5339\u914d\u4e0a&#xff0c;reload \u4e00\u6837\u8fd4\u56de\u6210\u529f&#xff09;\u3002<\/p>\n<p>\u52a0\u8f7d\u6210\u529f\u540e&#xff0c;Prometheus \u7684 Alerts \u9875\u9762\u957f\u8fd9\u6837&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908111711-6a9feeb7ecd7c.png\" alt=\"Prometheus Alerts \u9875\u9762\uff1ajenkins-alerts \u89c4\u5219\u7ec4\u5df2\u4ece \/prometheus\/rules\/jenkins-rules.yml \u52a0\u8f7d\uff0c11 \u6761\u89c4\u5219\u4e2d 10 \u6761 INACTIVE\u3001Jenkins\u6784\u5efa\u8fd0\u884c\u8d85\u65f6 \u4e00\u6761\u5904\u4e8e FIRING \u72b6\u6001\" \/><\/p>\n<p>\u56fe&#xff1a;jenkins-alerts \u89c4\u5219\u7ec4\u300111 \u6761\u89c4\u5219\u5168\u90e8\u52a0\u8f7d&#xff0c;\u53f3\u4e0a\u89d2 FIRING (1) \/ INACTIVE (10)\u2014\u2014\u90a3\u4e00\u6761 firing \u5c31\u662f\u5f00\u5934\u90a3\u4e2a\u6784\u5efa\u3002&#xff08;\u521a\u52a0\u8f7d\u90a3\u51e0\u5206\u949f\u5b83\u662f PENDING&#xff0c;for: 5m \u8d70\u5b8c\u624d\u8f6c firing\u3002&#xff09;<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u8fd9\u5957\u80fd\u8bc1\u660e\u4ec0\u4e48&#xff0c;\u4e0d\u80fd\u8bc1\u660e\u4ec0\u4e48<\/h3>\n<p>\u653e\u5728\u603b\u7ed3\u4e4b\u524d&#xff0c;\u56e0\u4e3a\u5b83\u6bd4\u4e0a\u9762\u6240\u6709\u5185\u5bb9\u90fd\u91cd\u8981\u3002<\/p>\n<p>\u2705 \u5df2\u7ecf\u505a\u5230\u7684&#xff1a;<\/p>\n<ul>\n<li>\u6307\u6807\u540d\u662f\u5b9e\u6d4b\u6293\u7684&#xff08;369 \u4e2a&#xff09;&#xff0c;\u4e0d\u662f\u4ece\u7f51\u4e0a\u6284\u7684&#xff1b;<\/li>\n<li>11 \u6761\u8868\u8fbe\u5f0f\u5728\u771f\u5b9e Prometheus \u4e0a\u9010\u6761\u67e5\u8be2\u9a8c\u8bc1\u8fc7&#xff0c;\u8bed\u6cd5\u6709\u6548\u3001\u6307\u6807\u80fd\u53d6\u5230\u6570&#xff1b;<\/li>\n<li>\u89c4\u5219\u6587\u4ef6\u7ecf promtool check rules \u6821\u9a8c\u901a\u8fc7\u2014\u2014\u26a0\ufe0f \u8fd9\u4e00\u6b65\u662f\u8865\u4e0a\u7684&#xff0c;\u7b2c\u4e00\u7248\u5c31\u56e0\u4e3a\u6a21\u677f\u51fd\u6570\u5199\u9519\u5bfc\u81f4 Prometheus \u8d77\u4e0d\u6765&#xff08;\u89c1 6.1&#xff09;&#xff1b;<\/li>\n<li>11 \u6761\u89c4\u5219\u5df2\u771f\u5b9e\u52a0\u8f7d\u8fdb Prometheus \u5e76\u8fd0\u884c&#xff08;api\/v1\/rules \u53ef\u89c1\u89c4\u5219\u7ec4\u300111 \u6761\u9f50\u5168&#xff09;&#xff0c;\u5176\u4e2d\u300c\u6784\u5efa\u8fd0\u884c\u8d85\u65f6\u300d\u5f53\u573a\u8fdb\u5165 pending\u3001for \u8d70\u5b8c\u8f6c firing&#xff0c;annotation \u6a21\u677f\u6e32\u67d3\u6b63\u786e&#xff1b;<\/li>\n<li>\u6bcf\u6761\u96f6\u547d\u4e2d\u7684\u89c4\u5219\u90fd\u56de\u9a8c\u4e86\u88f8\u6307\u6807&#xff0c;\u786e\u8ba4\u4e0d\u662f\u54d1\u5f39&#xff1b;<\/li>\n<li>\u90a3\u6761\u50f5\u5c38\u6784\u5efa\u662f\u771f\u5b9e\u53d1\u73b0&#xff0c;\u4e0d\u662f\u6784\u9020\u7684\u4f8b\u5b50\u2014\u2014\u5b83\u540e\u6765\u88ab\u8ffd\u5230\u4e86\u5e95&#xff08;\u85cf\u5728 Maven \u6a21\u5757\u9875\u3001abort \u6309\u94ae\u65e0\u6548&#xff09;&#xff0c;\u5b8c\u6574\u8fc7\u7a0b\u89c1\u59ca\u59b9\u7bc7\u3002<\/li>\n<\/ul>\n<p>\u274c \u8fd8\u6ca1\u505a\u5230\u7684&#xff1a;<\/p>\n<ul>\n<li>\u8fd8\u6ca1\u6709\u957f\u671f\u8fd0\u884c\u8fc7\u2014\u2014\u89c4\u5219\u5df2\u52a0\u8f7d\u5e76\u6b63\u5e38\u5de5\u4f5c&#xff0c;\u4f46\u8bef\u62a5\u7387\u8981\u8dd1\u4e00\u6bb5\u65f6\u95f4\u624d\u77e5\u9053\u3002for \u65f6\u957f\u548c\u9608\u503c\u5927\u6982\u7387\u8fd8\u8981\u6309\u5b9e\u9645\u566a\u58f0\u56de\u8c03&#xff1b;<\/li>\n<li>\u770b\u677f\u7684 4 \u4e2a No data \u548c 1 \u4e2a\u9519\u503c\u6211\u6ca1\u53bb\u4fee\u2014\u2014\u53ea\u5b9a\u4f4d\u5230\u300c\u770b\u677f\u67e5\u8be2\u4e0e\u5f53\u524d\u6307\u6807\u540d\u5bf9\u4e0d\u4e0a\u300d&#xff0c;\u6ca1\u9010\u4e2a\u6539 query&#xff08;\u89c1 4.1&#xff09;&#xff1b;<\/li>\n<li>\u6ca1\u6709\u8de8\u7248\u672c\u9a8c\u8bc1&#xff1a;Jenkins \u63d2\u4ef6\u7684\u6307\u6807\u968f\u7248\u672c\u589e\u51cf&#xff0c;\u672c\u6587\u5b9e\u6d4b\u4e8e 2026-09&#xff0c;\u4f60\u90a3\u8fb9\u5bf9\u4e0d\u4e0a\u5f88\u6b63\u5e38\u2014\u2014\u6240\u4ee5\u7b2c\u4e09\u8282\u624d\u8981\u4f60\u81ea\u5df1\u635e\u4e00\u904d&#xff1b;<\/li>\n<li>\u672c\u7bc7\u4e0d\u542b\u90a3\u6761\u6784\u5efa\u7684\u8ffd\u67e5\u8fc7\u7a0b\u2014\u2014\u5b83\u88ab\u62c6\u6210\u4e86\u59ca\u59b9\u7bc7&#xff0c;\u56e0\u4e3a\u90a3\u662f\u300c\u544a\u8b66\u54cd\u4e86\u4e4b\u540e\u600e\u4e48\u67e5\u300d&#xff0c;\u548c\u672c\u7bc7\u300c\u600e\u4e48\u628a\u544a\u8b66\u914d\u5bf9\u300d\u662f\u4e24\u4ef6\u4e8b\u3002<\/li>\n<\/ul>\n<p>\u6240\u4ee5\u8fd9\u7bc7\u7684\u5b9a\u4f4d\u662f**\u300c\u4e00\u5957\u53ef\u4ee5\u76f4\u63a5\u6284\u8d70\u7684\u8d77\u70b9\u300d&#xff0c;\u4e0d\u662f\u300c\u6211\u4eec\u7ebf\u4e0a\u8dd1\u4e86\u534a\u5e74\u300d\u7684\u6218\u62a5**\u3002<\/p>\n<hr \/>\n<h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<p>\u4e00\u53e5\u8bdd\u7248\u672c&#xff1a;\u7ed9 Jenkins \u914d\u76d1\u63a7&#xff0c;\u96be\u7684\u4e0d\u662f\u63a5\u5165\u548c\u770b\u677f\u2014\u2014\u90a3\u90fd\u662f\u73b0\u6210\u7684&#xff1b;\u96be\u7684\u662f\u60f3\u6e05\u695a\u8981\u544a\u4ec0\u4e48\u8b66&#xff0c;\u4ee5\u53ca\u600e\u4e48\u786e\u8ba4\u8fd9\u4e9b\u544a\u8b66\u4e0d\u662f\u54d1\u5f39\u3002<\/p>\n<p>\u56db\u4ef6\u5e26\u8d70\u7684\u4e8b&#xff1a;<\/p>\n<li>\n<p>\u6307\u6807\u540d\u5148\u81ea\u5df1\u635e\u4e00\u904d\u3002 \u63d2\u4ef6\u524d\u7f00\u53ef\u914d\u7f6e&#xff0c;\u7f51\u4e0a\u6587\u7ae0\u7684\u6307\u6807\u540d\u4e0d\u4e00\u5b9a\u662f\u4f60\u7684\u3002\u4e00\u6761 curl \u7684\u4e8b&#xff0c;\u7701\u4e0b\u7684\u662f\u300c\u914d\u5b8c\u53d1\u73b0\u6c38\u8fdc\u4e0d\u89e6\u53d1\u300d\u7684\u4e24\u5c0f\u65f6\u3002<\/p>\n<\/li>\n<li>\n<p>\u544a\u8b66\u4ece\u300c\u4f1a\u51fa\u4ec0\u4e48\u4e8b\u300d\u53cd\u63a8&#xff0c;\u522b\u4ece\u300c\u6709\u4ec0\u4e48\u6307\u6807\u300d\u6b63\u63a8\u3002 \u524d\u8005\u4f1a\u8ba9\u4f60\u5199\u51fa\u300cexecutor \u5360\u6ee1\u4f46 CPU \u7a7a\u95f2\u300d\u8fd9\u79cd\u89c4\u5219&#xff0c;\u540e\u8005\u53ea\u4f1a\u7ed9\u4f60\u300c\u5b9e\u4f8b\u6302\u4e86\u300d\u3002<\/p>\n<\/li>\n<li>\n<p>\u2b50 \u96f6\u544a\u8b66\u8981\u9a8c\u8fc7\u624d\u7b97\u6570\u3002 \u5e26\u9608\u503c\u7684\u67e5\u8be2\u8fd4\u56de\u7a7a&#xff0c;\u53ef\u80fd\u662f\u6ca1\u95ee\u9898&#xff0c;\u4e5f\u53ef\u80fd\u662f\u6307\u6807\u540d\u5199\u9519\u2014\u2014\u628a\u88f8\u6307\u6807\u518d\u67e5\u4e00\u904d&#xff0c;\u4e24\u5206\u949f\u7684\u4e8b\u3002\u5426\u5219\u4f60\u914d\u7684\u4e0d\u662f\u544a\u8b66&#xff0c;\u662f\u4e00\u6392\u7eff\u706f\u88c5\u9970\u3002<\/p>\n<\/li>\n<li>\n<p>&#x1f534; \u89c4\u5219\u6587\u4ef6\u4e0a\u7ebf\u524d\u5fc5\u987b promtool check rules\u3002 \u8fd9\u6761\u5355\u5217\u51fa\u6765&#xff0c;\u56e0\u4e3a\u5b83\u7684\u5931\u8d25\u65b9\u5f0f\u6700\u53cd\u76f4\u89c9&#xff1a;\u5199\u9519\u4e00\u884c&#xff0c;Prometheus \u4e0d\u662f\u8df3\u8fc7\u90a3\u6761\u89c4\u5219&#xff0c;\u662f\u62d2\u7edd\u542f\u52a8\u3002 \u4f60\u4ee5\u4e3a\u5728\u7ed9\u76d1\u63a7\u52a0\u4e1c\u897f&#xff0c;\u5b9e\u9645\u662f\u628a\u6574\u5957\u76d1\u63a7\u505c\u4e86\u2014\u2014\u800c\u4e14 api\/v1\/query \u90a3\u5957\u9a8c\u8bc1\u6839\u672c\u7167\u4e0d\u51fa\u6a21\u677f\u91cc\u7684\u9519&#xff08;\u89c1 6.1&#xff09;\u3002<\/p>\n<\/li>\n<p>\u6700\u540e\u8bf4\u56de\u5f00\u5934\u90a3\u6761\u6784\u5efa\u3002\u5b83\u4e0d\u62a5\u9519&#xff0c;\u4e5f\u4e0d\u4f1a\u89e6\u53d1\u4efb\u4f55\u901a\u77e5\u2014\u2014\u9664\u975e\u6709\u4eba\u4e3b\u52a8\u53bb\u7ffb\u90a3\u4e2a\u6307\u6807&#xff0c;\u5426\u5219\u4e09\u5468\u91cc\u4e0d\u4f1a\u6709\u4efb\u4f55\u4eba\u53d1\u73b0\u5b83\u3002Jenkins \u4e0a\u8fd9\u7c7b\u300c\u5b89\u9759\u7684\u574f\u6389\u300d\u8fdc\u6bd4\u300c\u8fdb\u7a0b\u6302\u4e86\u300d\u5e38\u89c1\u2014\u2014\u800c\u5b83\u4eec\u552f\u4e00\u4f1a\u7559\u4e0b\u75d5\u8ff9\u7684\u5730\u65b9&#xff0c;\u5c31\u662f\u4f60\u914d\u7684\u8fd9\u51e0\u6761\u89c4\u5219\u3002\u6240\u4ee5\u8fd9\u4e9b\u89c4\u5219\u662f\u4e0d\u662f\u54d1\u5f39&#xff0c;\u624d\u8fd9\u4e48\u8981\u7d27\u3002<\/p>\n<hr \/>\n<h3>\u5ef6\u4f38\u9605\u8bfb<\/h3>\n<table>\n<tr>\u60f3\u770b\u6587\u7ae0<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u2b50 \u59ca\u59b9\u7bc7&#xff1a;\u672c\u6587\u90a3\u6761\u300c\u6784\u5efa\u8fd0\u884c\u8d85\u65f6\u300d\u544a\u8b66\u54cd\u4e86\u4e4b\u540e&#xff0c;\u6211\u82b1\u4e86\u534a\u5929\u624d\u627e\u5230\u5b83\u2014\u2014\u5b83\u85cf\u5728\u54ea\u3001\u4e3a\u4ec0\u4e48 abort \u6309\u94ae\u70b9\u4e86\u6ca1\u7528<\/td>\n<td align=\"left\">\u3010\u5f85\u53d1\u5e03\u540e\u8865\u5145\u5f15\u7528\u5173\u7cfb&#xff1a;\u300aJenkins \u6784\u5efa\u5361\u4e86 23 \u5929&#xff0c;abort \u6309\u94ae\u70b9\u4e86\u6ca1\u7528\u300b\u3011<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u672c\u6587\u544a\u8b66\u89c4\u5219\u7684\u63a8\u5bfc\u6765\u6e90&#xff1a;17 \u4e2a\u628a CI\/CD \u6d41\u6c34\u7ebf\u5199\u5d29\u7684\u59ff\u52bf<\/td>\n<td align=\"left\">\u300aJenkinsfile \u53cd\u6a21\u5f0f\u56fe\u9274\u300b<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Prometheus &#043; Grafana &#043; Alertmanager \u600e\u4e48\u642d<\/td>\n<td align=\"left\">\u300aPrometheus &#043; Grafana &#043; AlertManager \u76d1\u63a7\u4f53\u7cfb\u642d\u5efa&#xff1a;Docker \u4e00\u628a\u68ad\u300b<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u5176\u5b83\u7ec4\u4ef6\u54ea\u4e9b\u8981\u88c5 Exporter\u3001\u54ea\u4e9b\u4e0d\u7528<\/td>\n<td align=\"left\">\u3010\u5f85\u53d1\u5e03\u540e\u8865\u5145\u5f15\u7528\u5173\u7cfb&#xff1a;\u300a\u4e2d\u95f4\u4ef6\u76d1\u63a7\u4e00\u6761\u9f99&#xff1a;\u54ea\u4e9b\u8981\u88c5 Exporter \u54ea\u4e9b\u4e0d\u7528\u300b\u3011<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Jenkins Prometheus \u63d2\u4ef6\u5b98\u65b9\u8bf4\u660e&#xff08;\u6307\u6807\u524d\u7f00\u3001\u914d\u7f6e\u9879&#xff09;<\/td>\n<td align=\"left\">Prometheus metrics \u00b7 Jenkins Plugins<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u63d2\u4ef6\u66b4\u9732\u7684\u5168\u90e8\u6307\u6807\u6e05\u5355<\/td>\n<td align=\"left\">prometheus-plugin \u00b7 docs\/metrics<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u672c\u6587\u7528\u7684 Grafana \u770b\u677f<\/td>\n<td align=\"left\">9964 \u00b7 Jenkins: Performance and Health Overview<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>\u7ed9\u8bfb\u8005\u7684\u5c0f\u95ee\u9898&#xff1a;\u4f60\u7684 Jenkins \u4e0a\u6709\u51e0\u6761\u544a\u8b66\u89c4\u5219&#xff1f; \u5982\u679c\u7b54\u6848\u662f 0&#xff0c;\u5efa\u8bae\u5148\u628a\u300c\u6784\u5efa\u8fd0\u884c\u8d85\u65f6\u300d\u90a3\u6761\u52a0\u4e0a\u2014\u2014\u6309\u6211\u7684\u7ecf\u9a8c&#xff0c;\u52a0\u5b8c\u5f53\u5929\u5c31\u53ef\u80fd\u6293\u5230\u4e1c\u897f\u3002<\/p>\n<hr \/>\n<p>&#x1f3f7;\ufe0f \u6807\u7b7e&#xff1a;Jenkins Prometheus Grafana \u544a\u8b66\u89c4\u5219 CI-CD \u76d1\u63a7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f4dd; \u6458\u8981&#xff1a;\u7ed9 Jenkins \u914d\u4e00\u5957\u5b8c\u6574\u76d1\u63a7&#xff0c;\u4e00\u6761\u9f99\u8d70\u5b8c\u56db\u6b65&#xff1a;\u88c5 Prometheus metrics \u63d2\u4ef6\u63a5\u5165&#xff08;\u4e24\u884c\u914d\u7f6e&#xff0c;\u26a0\ufe0f \u6307\u6807\u540d\u524d\u7f00\u53ef\u914d&#xff0c;\u7167\u6284\u7f51\u4e0a\u7684\u591a\u534a\u5bf9\u4e0d\u4e0a\u4f60\u7684&#xff09;\u3001\u5bfc Grafana \u770b\u677f 9964&#xff08;19 \u4e2a\u9762\u677f\u9010\u5757\u5b9e\u6d4b&#xff0c;4 \u4e2a No data\u30011 \u4e2a\u6570\u662f\u9519\u7684\u90fd\u6807\u51fa\u6765\u4e86&#xff09;\u300111 \u6761\u544a\u8b66\u89c4\u5219&#xff08;\u4ece Je<\/p>\n","protected":false},"author":2,"featured_media":102422,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11697,597,1647,392,678],"topic":[],"class_list":["post-102426","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-11697","tag-ci-cd","tag-grafana","tag-jenkins","tag-prometheus"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70 - \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\/102426.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f4dd; \u6458\u8981&#xff1a;\u7ed9 Jenkins \u914d\u4e00\u5957\u5b8c\u6574\u76d1\u63a7&#xff0c;\u4e00\u6761\u9f99\u8d70\u5b8c\u56db\u6b65&#xff1a;\u88c5 Prometheus metrics \u63d2\u4ef6\u63a5\u5165&#xff08;\u4e24\u884c\u914d\u7f6e&#xff0c;\u26a0\ufe0f \u6307\u6807\u540d\u524d\u7f00\u53ef\u914d&#xff0c;\u7167\u6284\u7f51\u4e0a\u7684\u591a\u534a\u5bf9\u4e0d\u4e0a\u4f60\u7684&#xff09;\u3001\u5bfc Grafana \u770b\u677f 9964&#xff08;19 \u4e2a\u9762\u677f\u9010\u5757\u5b9e\u6d4b&#xff0c;4 \u4e2a No data\u30011 \u4e2a\u6570\u662f\u9519\u7684\u90fd\u6807\u51fa\u6765\u4e86&#xff09;\u300111 \u6761\u544a\u8b66\u89c4\u5219&#xff08;\u4ece Je\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/102426.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-08T11:17:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908111708-6a9feeb4c8618.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=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102426.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/102426.html\",\"name\":\"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-08T11:17:13+00:00\",\"dateModified\":\"2026-09-08T11:17:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/102426.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/102426.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102426.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70\"}]},{\"@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":"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70 - \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\/102426.html","og_locale":"zh_CN","og_type":"article","og_title":"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f4dd; \u6458\u8981&#xff1a;\u7ed9 Jenkins \u914d\u4e00\u5957\u5b8c\u6574\u76d1\u63a7&#xff0c;\u4e00\u6761\u9f99\u8d70\u5b8c\u56db\u6b65&#xff1a;\u88c5 Prometheus metrics \u63d2\u4ef6\u63a5\u5165&#xff08;\u4e24\u884c\u914d\u7f6e&#xff0c;\u26a0\ufe0f \u6307\u6807\u540d\u524d\u7f00\u53ef\u914d&#xff0c;\u7167\u6284\u7f51\u4e0a\u7684\u591a\u534a\u5bf9\u4e0d\u4e0a\u4f60\u7684&#xff09;\u3001\u5bfc Grafana \u770b\u677f 9964&#xff08;19 \u4e2a\u9762\u677f\u9010\u5757\u5b9e\u6d4b&#xff0c;4 \u4e2a No data\u30011 \u4e2a\u6570\u662f\u9519\u7684\u90fd\u6807\u51fa\u6765\u4e86&#xff09;\u300111 \u6761\u544a\u8b66\u89c4\u5219&#xff08;\u4ece Je","og_url":"https:\/\/www.wsisp.com\/helps\/102426.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-08T11:17:13+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908111708-6a9feeb4c8618.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/102426.html","url":"https:\/\/www.wsisp.com\/helps\/102426.html","name":"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-08T11:17:13+00:00","dateModified":"2026-09-08T11:17:13+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/102426.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/102426.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/102426.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Jenkins \u76d1\u63a7\u4e00\u6761\u9f99\uff1a\u63a5\u5165\u3001\u770b\u677f 9964\u300111 \u6761\u544a\u8b66\u89c4\u5219\u76f4\u63a5\u6284\u8d70"}]},{"@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\/102426","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=102426"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/102426\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/102422"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=102426"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=102426"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=102426"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=102426"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}