{"id":6765,"date":"2025-05-01T20:22:12","date_gmt":"2025-05-01T12:22:12","guid":{"rendered":"https:\/\/t.n-years.com\/?p=6765"},"modified":"2025-05-01T20:22:12","modified_gmt":"2025-05-01T12:22:12","slug":"apm-%e7%b3%bb%e7%bb%9f%ef%bc%8clog%e3%80%81metric%e3%80%81trace-%e4%b9%8b%e9%97%b4%e7%9a%84%e5%85%b3%e7%b3%bb","status":"publish","type":"post","link":"https:\/\/t.n-years.com\/?p=6765","title":{"rendered":"APM \u7cfb\u7edf\uff0cLog\u3001Metric\u3001Trace \u4e4b\u95f4\u7684\u5173\u7cfb"},"content":{"rendered":"<p>\u5728\u73b0\u4ee3\u7684\u8f6f\u4ef6\u7cfb\u7edf\u76d1\u63a7\u548c\u53ef\u89c2\u6d4b\u6027\u9886\u57df\u4e2d\uff0cLog\uff08\u65e5\u5fd7\uff09\u3001Metric\uff08\u6307\u6807\uff09\u548cTrace\uff08\u8ffd\u8e2a\uff09\u662f\u4e09\u4e2a\u5173\u952e\u7684\u6982\u5ff5\uff0c\u5b83\u4eec\u4e4b\u95f4\u76f8\u4e92\u5173\u8054\u3001\u76f8\u8f85\u76f8\u6210\uff0c\u5171\u540c\u4e3a\u7406\u89e3\u7cfb\u7edf\u7684\u8fd0\u884c\u72b6\u6001\u63d0\u4f9b\u5168\u9762\u7684\u89c6\u89d2\u3002\u4ee5\u4e0b\u662f\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a<\/p>\n<ul>\n<li><strong>\u76f8\u4e92\u8865\u5145<\/strong>\n<ul>\n<li><strong>Log<\/strong>\uff1a\u63d0\u4f9b\u4e86\u7cfb\u7edf\u4e2d\u53d1\u751f\u7684\u5177\u4f53\u4e8b\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u65f6\u95f4\u3001\u5730\u70b9\u3001\u4e8b\u4ef6\u5185\u5bb9\u7b49\uff0c\u4ee5\u6587\u672c\u5f62\u5f0f\u8bb0\u5f55\u7cfb\u7edf\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\u5404\u79cd\u7ec6\u8282\uff0c\u53ef\u7528\u4e8e\u6df1\u5165\u8c03\u67e5\u7279\u5b9a\u4e8b\u4ef6\u6216\u95ee\u9898\u3002\u4f8b\u5982\uff0c\u8bb0\u5f55\u7528\u6237\u767b\u5f55\u5931\u8d25\u7684\u8be6\u7ec6\u539f\u56e0\u3001\u67d0\u4e2a\u51fd\u6570\u6267\u884c\u65f6\u7684\u53c2\u6570\u548c\u8fd4\u56de\u503c\u7b49\u3002<\/li>\n<li><strong>Metric<\/strong>\uff1a\u4ee5\u6570\u503c\u5f62\u5f0f\u91cf\u5316\u7cfb\u7edf\u7684\u5404\u79cd\u5c5e\u6027\u548c\u6027\u80fd\u6307\u6807\uff0c\u5982CPU\u4f7f\u7528\u7387\u3001\u5185\u5b58\u5360\u7528\u3001\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u7b49\uff0c\u80fd\u5e2e\u52a9\u5feb\u901f\u4e86\u89e3\u7cfb\u7edf\u7684\u6574\u4f53\u8fd0\u884c\u72b6\u51b5\u548c\u8d8b\u52bf\uff0c\u7528\u4e8e\u76d1\u63a7\u7cfb\u7edf\u6027\u80fd\u548c\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n<li><strong>Trace<\/strong>\uff1a\u4e3b\u8981\u7528\u4e8e\u8ddf\u8e2a\u8bf7\u6c42\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u4f20\u64ad\u8def\u5f84\u548c\u8c03\u7528\u5173\u7cfb\uff0c\u901a\u8fc7\u552f\u4e00\u7684Trace ID\u5c06\u4e00\u4e2a\u8bf7\u6c42\u6d89\u53ca\u7684\u591a\u4e2a\u670d\u52a1\u6216\u7ec4\u4ef6\u7684\u8c03\u7528\u4e32\u8054\u8d77\u6765\uff0c\u53ef\u7528\u4e8e\u5206\u6790\u7cfb\u7edf\u7684\u5206\u5e03\u5f0f\u67b6\u6784\u4e2d\u7684\u6027\u80fd\u74f6\u9888\u548c\u6545\u969c\u5b9a\u4f4d\u3002\u4f8b\u5982\uff0c\u4e00\u4e2a\u7535\u5546\u8ba2\u5355\u4ece\u4e0b\u5355\u5230\u652f\u4ed8\u5b8c\u6210\uff0cTrace\u53ef\u4ee5\u8bb0\u5f55\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u7ecf\u8fc7\u7684\u5404\u4e2a\u5fae\u670d\u52a1\u7684\u8c03\u7528\u987a\u5e8f\u548c\u65f6\u95f4\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u6570\u636e\u5173\u8054<\/strong>\n<ul>\n<li><strong>Log<\/strong>\u4e2d\u53ef\u80fd\u5305\u542b\u4e0eMetric\u548cTrace\u76f8\u5173\u7684\u4fe1\u606f\uff0c\u4f8b\u5982\uff0c\u65e5\u5fd7\u4e2d\u53ef\u80fd\u8bb0\u5f55\u4e86\u67d0\u4e2a\u8bf7\u6c42\u7684\u54cd\u5e94\u65f6\u95f4\uff08\u4e0eMetric\u76f8\u5173\uff09\u4ee5\u53ca\u8be5\u8bf7\u6c42\u7684Trace ID\uff0c\u901a\u8fc7Trace ID\u53ef\u4ee5\u5c06Log\u4e0e\u76f8\u5e94\u7684Trace\u5173\u8054\u8d77\u6765\uff0c\u4ece\u800c\u5728\u5206\u6790\u95ee\u9898\u65f6\u80fd\u591f\u7ed3\u5408\u8be6\u7ec6\u7684\u65e5\u5fd7\u4fe1\u606f\u548c\u8bf7\u6c42\u7684\u5b8c\u6574\u8c03\u7528\u94fe\u3002<\/li>\n<li><strong>Metric<\/strong>\u6570\u636e\u53ef\u4ee5\u4f5c\u4e3aTrace\u5206\u6790\u7684\u4e00\u90e8\u5206\uff0c\u6bd4\u5982\u5728\u5206\u6790\u4e00\u4e2a\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u6027\u80fd\u65f6\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u901a\u8fc7Trace\u67e5\u770b\u5404\u4e2a\u8282\u70b9\u7684\u8c03\u7528\u987a\u5e8f\u548c\u65f6\u95f4\uff0c\u8fd8\u53ef\u4ee5\u7ed3\u5408\u76f8\u5173\u8282\u70b9\u7684\u6027\u80fd\u6307\u6807\uff08\u5982CPU\u3001\u5185\u5b58\u4f7f\u7528\u7b49Metric\u6570\u636e\uff09\u6765\u5168\u9762\u8bc4\u4f30\u7cfb\u7edf\u6027\u80fd\u3002<\/li>\n<li><strong>Trace<\/strong>\u53ef\u4ee5\u5e2e\u52a9\u5b9a\u4f4d\u4ea7\u751f\u7279\u5b9aMetric\u6570\u636e\u6216Log\u4fe1\u606f\u7684\u5177\u4f53\u8bf7\u6c42\u6216\u4e1a\u52a1\u6d41\u7a0b\u3002\u4f8b\u5982\uff0c\u5f53\u53d1\u73b0\u67d0\u4e2a\u65f6\u95f4\u6bb5\u5185\u7cfb\u7edf\u7684\u9519\u8bef\u7387\u6307\u6807\u7a81\u7136\u5347\u9ad8\uff0c\u53ef\u4ee5\u901a\u8fc7Trace\u627e\u5230\u90a3\u4e9b\u5bfc\u81f4\u9519\u8bef\u7684\u5177\u4f53\u8bf7\u6c42\u94fe\u8def\uff0c\u518d\u7ed3\u5408\u76f8\u5173\u7684Log\u6765\u5206\u6790\u9519\u8bef\u4ea7\u751f\u7684\u539f\u56e0\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5171\u540c\u670d\u52a1\u4e8e\u7cfb\u7edf\u76d1\u63a7\u4e0e\u6545\u969c\u6392\u67e5<\/strong>\n<ul>\n<li><strong>Log<\/strong>\u53ef\u4ee5\u63d0\u4f9b\u95ee\u9898\u53d1\u751f\u65f6\u7684\u8be6\u7ec6\u4e0a\u4e0b\u6587\u4fe1\u606f\uff0c\u5e2e\u52a9\u786e\u5b9a\u95ee\u9898\u7684\u5177\u4f53\u539f\u56e0\u3002<\/li>\n<li><strong>Metric<\/strong>\u80fd\u4ece\u5b8f\u89c2\u4e0a\u5feb\u901f\u53d1\u73b0\u7cfb\u7edf\u6027\u80fd\u5f02\u5e38\uff0c\u4e3a\u6545\u969c\u6392\u67e5\u63d0\u4f9b\u65b9\u5411\u3002<\/li>\n<li><strong>Trace<\/strong>\u5219\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u8d77\u5230\u4e32\u8054\u5404\u4e2a\u670d\u52a1\u548c\u7ec4\u4ef6\u7684\u4f5c\u7528\uff0c\u5e2e\u52a9\u8ffd\u8e2a\u95ee\u9898\u7684\u4f20\u64ad\u8def\u5f84\uff0c\u627e\u5230\u95ee\u9898\u7684\u6839\u6e90\u6240\u5728\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Log\u3001Metric\u548cTrace\u662f\u4e00\u4e2a\u6709\u673a\u7684\u6574\u4f53\uff0c\u5728\u8f6f\u4ef6\u7cfb\u7edf\u7684\u76d1\u63a7\u3001\u6027\u80fd\u4f18\u5316\u548c\u6545\u969c\u6392\u67e5\u4e2d\uff0c\u9700\u8981\u7efc\u5408\u5229\u7528\u8fd9\u4e09\u79cd\u6570\u636e\uff0c\u624d\u80fd\u66f4\u5168\u9762\u3001\u51c6\u786e\u5730\u4e86\u89e3\u7cfb\u7edf\u7684\u8fd0\u884c\u72b6\u6001\uff0c\u5feb\u901f\u53d1\u73b0\u548c\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u73b0\u4ee3\u7684\u8f6f\u4ef6\u7cfb\u7edf\u76d1\u63a7\u548c\u53ef\u89c2\u6d4b\u6027\u9886\u57df\u4e2d\uff0cLog\uff08\u65e5\u5fd7\uff09\u3001Metric\uff08\u6307\u6807\uff09\u548cTrace\uff08\u8ffd\u8e2a\uff09\u662f\u4e09\u4e2a\u5173\u952e\u7684\u6982\u5ff5&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/t.n-years.com\/?p=6765\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[158],"tags":[],"class_list":["post-6765","post","type-post","status-publish","format-standard","hentry","category-apm"],"_links":{"self":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6765"}],"version-history":[{"count":1,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6765\/revisions"}],"predecessor-version":[{"id":6766,"href":"https:\/\/t.n-years.com\/index.php?rest_route=\/wp\/v2\/posts\/6765\/revisions\/6766"}],"wp:attachment":[{"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/t.n-years.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}