{"id":49,"date":"2026-01-22T10:00:00","date_gmt":"2026-01-22T02:00:00","guid":{"rendered":"http:\/\/localhost:8888\/?p=49"},"modified":"2026-07-09T16:17:45","modified_gmt":"2026-07-09T08:17:45","slug":"%e6%b5%8b%e8%af%95%e5%8f%b3%e7%a7%bb%e4%b8%8e%e7%94%9f%e4%ba%a7%e7%9b%91%e6%8e%a7","status":"publish","type":"post","link":"https:\/\/blog.runnergo.cn\/?p=49","title":{"rendered":"\u6d4b\u8bd5\u53f3\u79fb\u4e0e\u751f\u4ea7\u76d1\u63a7 &#8211; \u53d1\u5e03\u540e\u7684\u8d28\u91cf\u4fdd\u969c\u7b56\u7565"},"content":{"rendered":"<h1>\u6d4b\u8bd5\u53f3\u79fb\u4e0e\u751f\u4ea7\u76d1\u63a7 &#8211; \u53d1\u5e03\u540e\u7684\u8d28\u91cf\u4fdd\u969c\u7b56\u7565<\/h1>\n<p>&gt; \u4f5c\u8005\uff1a\u751f\u4ea7\u5b88\u62a4\u8005<br \/>\n&#8212;<\/p>\n<h2>\u524d\u8a00<\/h2>\n<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u751f\u4ea7\u5b88\u62a4\u8005\u3002\u505a\u751f\u4ea7\u73af\u5883\u76d1\u63a7\u548c\u8fd0\u7ef47\u5e74\uff0c\u6df1\u77e5\u53d1\u5e03\u540e\u7684\u8d28\u91cf\u4fdd\u969c\u6709\u591a\u91cd\u8981\u3002\u6d4b\u8bd5\u5de6\u79fb\u5f88\u91cd\u8981\uff0c\u6d4b\u8bd5\u53f3\u79fb\u540c\u6837\u5173\u952e\u3002\u4eca\u5929\u5206\u4eab\u6d4b\u8bd5\u53f3\u79fb\u7684\u5b9e\u8df5\u65b9\u6cd5\u3002<\/p>\n<p>&#8212;<\/p>\n<h2>\u4e00\u3001\u4ec0\u4e48\u662f\u6d4b\u8bd5\u53f3\u79fb\uff1f<\/h2>\n<h3>\u6982\u5ff5<\/h3>\n<p>\u6d4b\u8bd5\u53f3\u79fb\u662f\u6307\u5c06\u6d4b\u8bd5\u6d3b\u52a8\u5ef6\u4f38\u5230\u751f\u4ea7\u73af\u5883\uff1a<\/p>\n<ul>\n<li>\u751f\u4ea7\u73af\u5883\u76d1\u63a7<\/li>\n<li>\u771f\u5b9e\u7528\u6237\u53cd\u9988\u6536\u96c6<\/li>\n<li>\u751f\u4ea7\u73af\u5883\u6d4b\u8bd5<\/li>\n<li>\u5feb\u901f\u95ee\u9898\u54cd\u5e94<\/li>\n<\/ul>\n<h3>\u53f3\u79fb\u7684\u4ef7\u503c<\/h3>\n<p>| \u4ef7\u503c | \u8bf4\u660e |<br \/>\n|&#8212;&#8212;|&#8212;&#8212;|<br \/>\n| \u771f\u5b9e\u573a\u666f | \u751f\u4ea7\u73af\u5883\u6700\u771f\u5b9e |<br \/>\n| \u5feb\u901f\u53cd\u9988 | \u95ee\u9898\u7b2c\u4e00\u65f6\u95f4\u53d1\u73b0 |<br \/>\n| \u7528\u6237\u89c6\u89d2 | \u4ece\u7528\u6237\u89d2\u5ea6\u53d1\u73b0\u95ee\u9898 |<br \/>\n| \u6301\u7eed\u6539\u8fdb | \u57fa\u4e8e\u771f\u5b9e\u6570\u636e\u4f18\u5316 |<\/p>\n<p>&#8212;<\/p>\n<h2>\u4e8c\u3001\u751f\u4ea7\u73af\u5883\u76d1\u63a7<\/h2>\n<h3>\u5173\u952e\u76d1\u63a7\u6307\u6807<\/h3>\n<p>| \u6307\u6807\u7c7b\u578b | \u5177\u4f53\u6307\u6807 |<br \/>\n|&#8212;&#8212;&#8212;-|&#8212;&#8212;&#8212;-|<br \/>\n| \u53ef\u7528\u6027 | \u670d\u52a1\u5b58\u6d3b\u3001\u5065\u5eb7\u68c0\u67e5 |<br \/>\n| \u6027\u80fd | \u54cd\u5e94\u65f6\u95f4\u3001TPS |<br \/>\n| \u9519\u8bef\u7387 | HTTP\u9519\u8bef\u7387\u3001\u4e1a\u52a1\u9519\u8bef\u7387 |<br \/>\n| \u8d44\u6e90 | CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc |<\/p>\n<h3>\u76d1\u63a7\u67b6\u6784<\/h3>\n<p><code>`<\/code><br \/>\n\u5e94\u7528\u670d\u52a1 -&gt; \u6307\u6807\u91c7\u96c6 -&gt; \u65f6\u5e8f\u6570\u636e\u5e93 -&gt; \u53ef\u89c6\u5316 -&gt; \u544a\u8b66<br \/>\n<code>`<\/code><\/p>\n<h3>Prometheus + Grafana<\/h3>\n<p><code>`<\/code>yaml<\/p>\n<h1>Prometheus\u914d\u7f6e<\/h1>\n<p>scrape_configs:<br \/>\n  &#8211; job_name: &#8216;app&#8217;<br \/>\n    static_configs:<br \/>\n      &#8211; targets: [&#8216;app:8080&#8217;]<\/p>\n<p>  &#8211; job_name: &#8216;node&#8217;<br \/>\n    static_configs:<br \/>\n      &#8211; targets: [&#8216;node-exporter:9100&#8217;]<\/p>\n<h1>\u544a\u8b66\u89c4\u5219<\/h1>\n<p>groups:<br \/>\n  &#8211; name: app_alerts<br \/>\n    rules:<br \/>\n      &#8211; alert: HighErrorRate<br \/>\n        expr: rate(http_errors[5m]) &gt; 0.05<br \/>\n        for: 5m<br \/>\n        annotations:<br \/>\n          summary: &#8220;\u9ad8\u9519\u8bef\u7387\u544a\u8b66&#8221;<br \/>\n<code>`<\/code><\/p>\n<p>&#8212;<\/p>\n<h2>\u4e09\u3001\u751f\u4ea7\u73af\u5883\u6d4b\u8bd5<\/h2>\n<h3>\u7070\u5ea6\u53d1\u5e03\u6d4b\u8bd5<\/h3>\n<p><code>`<\/code>yaml<br \/>\n\u7070\u5ea6\u7b56\u7565:<br \/>\n  \u7b2c\u4e00\u9636\u6bb5: 5%\u6d41\u91cf\u5230\u65b0\u7248\u672c<br \/>\n  \u7b2c\u4e8c\u9636\u6bb5: 20%\u6d41\u91cf\u5230\u65b0\u7248\u672c<br \/>\n  \u7b2c\u4e09\u9636\u6bb5: 50%\u6d41\u91cf\u5230\u65b0\u7248\u672c<br \/>\n  \u7b2c\u56db\u9636\u6bb5: 100%\u6d41\u91cf\u5230\u65b0\u7248\u672c<br \/>\n<code>`<\/code><\/p>\n<h3>\u7ebf\u4e0a\u5192\u70df\u6d4b\u8bd5<\/h3>\n<p>\u53d1\u5e03\u540e\u81ea\u52a8\u6267\u884c\uff1a<\/p>\n<p><code>`<\/code>bash<br \/>\n#!\/bin\/bash<\/p>\n<h1>\u53d1\u5e03\u540e\u5192\u70df\u6d4b\u8bd5<\/h1>\n<h1>\u68c0\u67e5\u670d\u52a1\u5065\u5eb7<\/h1>\n<p>curl -f http:\/\/app:8080\/health || exit 1<\/p>\n<h1>\u6267\u884c\u5173\u952e\u4e1a\u52a1\u6d4b\u8bd5<\/h1>\n<p>curl -f http:\/\/app:8080\/api\/users || exit 1<\/p>\n<h1>\u68c0\u67e5\u65e5\u5fd7\u9519\u8bef<\/h1>\n<p>if grep -q &#8220;ERROR&#8221; \/var\/log\/app.log; then<br \/>\n    exit 1<br \/>\nfi<br \/>\n<code>`<\/code><\/p>\n<p>&#8212;<\/p>\n<h2>\u56db\u3001\u6df7\u6c8c\u5de5\u7a0b<\/h2>\n<h3>\u6545\u969c\u6ce8\u5165\u6d4b\u8bd5<\/h3>\n<p>\u4e3b\u52a8\u6ce8\u5165\u6545\u969c\uff0c\u9a8c\u8bc1\u7cfb\u7edf\u97e7\u6027\uff1a<\/p>\n<p>| \u6545\u969c\u7c7b\u578b | \u5de5\u5177 |<br \/>\n|&#8212;&#8212;&#8212;-|&#8212;&#8212;|<br \/>\n| \u7f51\u7edc\u5ef6\u8fdf | tc\u3001Chaos Mesh |<br \/>\n| \u670d\u52a1\u5b95\u673a | Chaos Monkey |<br \/>\n| \u8d44\u6e90\u8017\u5c3d | stress |<br \/>\n| \u78c1\u76d8\u6ee1 | dd |<\/p>\n<h3>Chaos Mesh\u793a\u4f8b<\/h3>\n<p><code>`<\/code>yaml<br \/>\napiVersion: chaos-mesh.org\/v1alpha1<br \/>\nkind: NetworkChaos<br \/>\nmetadata:<br \/>\n  name: network-delay<br \/>\nspec:<br \/>\n  action: delay<br \/>\n  mode: one<br \/>\n  selector:<br \/>\n    namespaces:<br \/>\n      &#8211; default<br \/>\n    labelSelectors:<br \/>\n      app: my-app<br \/>\n  delay:<br \/>\n    latency: &#8220;100ms&#8221;<br \/>\n    correlation: &#8220;50&#8221;<br \/>\n  duration: &#8220;5m&#8221;<br \/>\n<code>`<\/code><\/p>\n<p>&#8212;<\/p>\n<h2>\u4e94\u3001RunnerGo\u751f\u4ea7\u76d1\u63a7<\/h2>\n<p>RunnerGo\u53ef\u4ee5\u7528\u4e8e\uff1a<\/p>\n<ul>\n<li>\u5b9a\u65f6\u5065\u5eb7\u68c0\u67e5<\/li>\n<li>\u5173\u952e\u63a5\u53e3\u76d1\u63a7<\/li>\n<li>\u6027\u80fd\u8d8b\u52bf\u5206\u6790<\/li>\n<\/ul>\n<p><code>`<\/code>yaml<br \/>\n\u5b9a\u65f6\u4efb\u52a1:<br \/>\n  \u540d\u79f0: \u751f\u4ea7\u63a5\u53e3\u5065\u5eb7\u68c0\u67e5<br \/>\n  \u6267\u884c\u5468\u671f: *\/5 * * * *<br \/>\n  \u6d4b\u8bd5\u573a\u666f: \u5173\u952e\u4e1a\u52a1\u63a5\u53e3<br \/>\n  \u901a\u77e5: \u4f01\u4e1a\u5fae\u4fe1<br \/>\n<code>`<\/code><\/p>\n<p>&#8212;<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u6d4b\u8bd5\u53f3\u79fb\u8981\u70b9\uff1a<\/p>\n<p>| \u73af\u8282 | \u5b9e\u8df5 |<br \/>\n|&#8212;&#8212;|&#8212;&#8212;|<br \/>\n| \u76d1\u63a7 | Prometheus + Grafana |<br \/>\n| \u7070\u5ea6 | \u6e10\u8fdb\u5f0f\u53d1\u5e03 |<br \/>\n| \u7ebf\u4e0a\u6d4b\u8bd5 | \u5192\u70df\u3001\u6df7\u6c8c\u5de5\u7a0b |<br \/>\n| \u5feb\u901f\u54cd\u5e94 | \u544a\u8b66\u3001\u56de\u6eda\u673a\u5236 |<\/p>\n<p>&#8212;<\/p>\n<p><strong>\u672c\u7cfb\u521725\u7bc7\u6587\u7ae0\u5df2\u5168\u90e8\u5b8c\u6210\uff01\u611f\u8c22\u5927\u5bb6\u6301\u7eed\u5173\u6ce8RunnerGo\u535a\u5ba2\u3002<\/strong><\/p>\n<p>&gt; \u4f5c\u8005\uff1a\u751f\u4ea7\u5b88\u62a4\u8005\uff0c7\u5e74\u751f\u4ea7\u73af\u5883\u8fd0\u7ef4\u7ecf\u9a8c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6d4b\u8bd5\u53f3\u79fb\u4e0e\u751f\u4ea7\u76d1\u63a7 &#8211; \u53d1\u5e03\u540e\u7684\u8d28\u91cf\u4fdd\u969c\u7b56\u7565 &gt; \u4f5c\u8005\uff1a\u751f\u4ea7\u5b88\u62a4\u8005 &#8212; \u524d\u8a00 \u5927\u5bb6\u597d\uff0c\u6211\u662f\u751f\u4ea7\u5b88\u62a4\u8005\u3002\u505a\u751f\u4ea7\u73af\u5883\u76d1\u63a7\u548c\u8fd0\u7ef47\u5e74\uff0c\u6df1\u77e5\u53d1\u5e03\u540e\u7684\u8d28\u91cf\u4fdd\u969c\u6709\u591a\u91cd\u8981\u3002\u6d4b\u8bd5\u5de6\u79fb\u5f88\u91cd&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=49"}],"version-history":[{"count":0,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts\/49\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}