{"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 - \u53d1\u5e03\u540e\u7684\u8d28\u91cf\u4fdd\u969c\u7b56\u7565<\/h1>\n\n&gt; \u4f5c\u8005\uff1a\u751f\u4ea7\u5b88\u62a4\u8005\n---\n\n<h2>\u524d\u8a00<\/h2>\n\n\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\n\n---\n\n<h2>\u4e00\u3001\u4ec0\u4e48\u662f\u6d4b\u8bd5\u53f3\u79fb\uff1f<\/h2>\n\n<h3>\u6982\u5ff5<\/h3>\n\n\u6d4b\u8bd5\u53f3\u79fb\u662f\u6307\u5c06\u6d4b\u8bd5\u6d3b\u52a8\u5ef6\u4f38\u5230\u751f\u4ea7\u73af\u5883\uff1a\n<ul><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\n| \u4ef7\u503c | \u8bf4\u660e |\n|------|------|\n| \u771f\u5b9e\u573a\u666f | \u751f\u4ea7\u73af\u5883\u6700\u771f\u5b9e |\n| \u5feb\u901f\u53cd\u9988 | \u95ee\u9898\u7b2c\u4e00\u65f6\u95f4\u53d1\u73b0 |\n| \u7528\u6237\u89c6\u89d2 | \u4ece\u7528\u6237\u89d2\u5ea6\u53d1\u73b0\u95ee\u9898 |\n| \u6301\u7eed\u6539\u8fdb | \u57fa\u4e8e\u771f\u5b9e\u6570\u636e\u4f18\u5316 |\n\n---\n\n<h2>\u4e8c\u3001\u751f\u4ea7\u73af\u5883\u76d1\u63a7<\/h2>\n\n<h3>\u5173\u952e\u76d1\u63a7\u6307\u6807<\/h3>\n\n| \u6307\u6807\u7c7b\u578b | \u5177\u4f53\u6307\u6807 |\n|----------|----------|\n| \u53ef\u7528\u6027 | \u670d\u52a1\u5b58\u6d3b\u3001\u5065\u5eb7\u68c0\u67e5 |\n| \u6027\u80fd | \u54cd\u5e94\u65f6\u95f4\u3001TPS |\n| \u9519\u8bef\u7387 | HTTP\u9519\u8bef\u7387\u3001\u4e1a\u52a1\u9519\u8bef\u7387 |\n| \u8d44\u6e90 | CPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc |\n\n<h3>\u76d1\u63a7\u67b6\u6784<\/h3>\n\n<code>`<\/code>\n\u5e94\u7528\u670d\u52a1 -&gt; \u6307\u6807\u91c7\u96c6 -&gt; \u65f6\u5e8f\u6570\u636e\u5e93 -&gt; \u53ef\u89c6\u5316 -&gt; \u544a\u8b66\n<code>`<\/code>\n\n<h3>Prometheus + Grafana<\/h3>\n\n<code>`<\/code>yaml\n<h1>Prometheus\u914d\u7f6e<\/h1>\nscrape_configs:\n  - job_name: 'app'\n    static_configs:\n      - targets: ['app:8080']\n\n  - job_name: 'node'\n    static_configs:\n      - targets: ['node-exporter:9100']\n\n<h1>\u544a\u8b66\u89c4\u5219<\/h1>\ngroups:\n  - name: app_alerts\n    rules:\n      - alert: HighErrorRate\n        expr: rate(http_errors[5m]) &gt; 0.05\n        for: 5m\n        annotations:\n          summary: \"\u9ad8\u9519\u8bef\u7387\u544a\u8b66\"\n<code>`<\/code>\n\n---\n\n<h2>\u4e09\u3001\u751f\u4ea7\u73af\u5883\u6d4b\u8bd5<\/h2>\n\n<h3>\u7070\u5ea6\u53d1\u5e03\u6d4b\u8bd5<\/h3>\n\n<code>`<\/code>yaml\n\u7070\u5ea6\u7b56\u7565:\n  \u7b2c\u4e00\u9636\u6bb5: 5%\u6d41\u91cf\u5230\u65b0\u7248\u672c\n  \u7b2c\u4e8c\u9636\u6bb5: 20%\u6d41\u91cf\u5230\u65b0\u7248\u672c\n  \u7b2c\u4e09\u9636\u6bb5: 50%\u6d41\u91cf\u5230\u65b0\u7248\u672c\n  \u7b2c\u56db\u9636\u6bb5: 100%\u6d41\u91cf\u5230\u65b0\u7248\u672c\n<code>`<\/code>\n\n<h3>\u7ebf\u4e0a\u5192\u70df\u6d4b\u8bd5<\/h3>\n\n\u53d1\u5e03\u540e\u81ea\u52a8\u6267\u884c\uff1a\n\n<code>`<\/code>bash\n#!\/bin\/bash\n<h1>\u53d1\u5e03\u540e\u5192\u70df\u6d4b\u8bd5<\/h1>\n\n<h1>\u68c0\u67e5\u670d\u52a1\u5065\u5eb7<\/h1>\ncurl -f http:\/\/app:8080\/health || exit 1\n\n<h1>\u6267\u884c\u5173\u952e\u4e1a\u52a1\u6d4b\u8bd5<\/h1>\ncurl -f http:\/\/app:8080\/api\/users || exit 1\n\n<h1>\u68c0\u67e5\u65e5\u5fd7\u9519\u8bef<\/h1>\nif grep -q \"ERROR\" \/var\/log\/app.log; then\n    exit 1\nfi\n<code>`<\/code>\n\n---\n\n<h2>\u56db\u3001\u6df7\u6c8c\u5de5\u7a0b<\/h2>\n\n<h3>\u6545\u969c\u6ce8\u5165\u6d4b\u8bd5<\/h3>\n\n\u4e3b\u52a8\u6ce8\u5165\u6545\u969c\uff0c\u9a8c\u8bc1\u7cfb\u7edf\u97e7\u6027\uff1a\n\n| \u6545\u969c\u7c7b\u578b | \u5de5\u5177 |\n|----------|------|\n| \u7f51\u7edc\u5ef6\u8fdf | tc\u3001Chaos Mesh |\n| \u670d\u52a1\u5b95\u673a | Chaos Monkey |\n| \u8d44\u6e90\u8017\u5c3d | stress |\n| \u78c1\u76d8\u6ee1 | dd |\n\n<h3>Chaos Mesh\u793a\u4f8b<\/h3>\n\n<code>`<\/code>yaml\napiVersion: chaos-mesh.org\/v1alpha1\nkind: NetworkChaos\nmetadata:\n  name: network-delay\nspec:\n  action: delay\n  mode: one\n  selector:\n    namespaces:\n      - default\n    labelSelectors:\n      app: my-app\n  delay:\n    latency: \"100ms\"\n    correlation: \"50\"\n  duration: \"5m\"\n<code>`<\/code>\n\n---\n\n<h2>\u4e94\u3001RunnerGo\u751f\u4ea7\u76d1\u63a7<\/h2>\n\nRunnerGo\u53ef\u4ee5\u7528\u4e8e\uff1a\n<ul><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<code>`<\/code>yaml\n\u5b9a\u65f6\u4efb\u52a1:\n  \u540d\u79f0: \u751f\u4ea7\u63a5\u53e3\u5065\u5eb7\u68c0\u67e5\n  \u6267\u884c\u5468\u671f: *\/5 * * * *\n  \u6d4b\u8bd5\u573a\u666f: \u5173\u952e\u4e1a\u52a1\u63a5\u53e3\n  \u901a\u77e5: \u4f01\u4e1a\u5fae\u4fe1\n<code>`<\/code>\n\n---\n\n<h2>\u603b\u7ed3<\/h2>\n\n\u6d4b\u8bd5\u53f3\u79fb\u8981\u70b9\uff1a\n\n| \u73af\u8282 | \u5b9e\u8df5 |\n|------|------|\n| \u76d1\u63a7 | Prometheus + Grafana |\n| \u7070\u5ea6 | \u6e10\u8fdb\u5f0f\u53d1\u5e03 |\n| \u7ebf\u4e0a\u6d4b\u8bd5 | \u5192\u70df\u3001\u6df7\u6c8c\u5de5\u7a0b |\n| \u5feb\u901f\u54cd\u5e94 | \u544a\u8b66\u3001\u56de\u6eda\u673a\u5236 |\n\n---\n\n<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>\n\n&gt; \u4f5c\u8005\uff1a\u751f\u4ea7\u5b88\u62a4\u8005\uff0c7\u5e74\u751f\u4ea7\u73af\u5883\u8fd0\u7ef4\u7ecf\u9a8c","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\u8981\uff0c\u6d4b\u8bd5\u53f3\u79fb\u540c\u6837\u5173\u952e&#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}]}}