{"id":10415,"date":"2024-09-19T17:55:28","date_gmt":"2024-09-19T09:55:28","guid":{"rendered":"https:\/\/www.yunshan.net\/blog\/?p=10415"},"modified":"2024-09-19T17:55:28","modified_gmt":"2024-09-19T09:55:28","slug":"%e6%b7%b1%e5%85%a5%e7%a0%94%e7%a9%b6prometheus%e6%8a%80%e6%9c%af%e7%89%b9%e7%82%b9%ef%bc%9a%e7%8b%ac%e7%89%b9%e8%80%8c%e5%bc%ba%e5%a4%a7%e7%9a%84%e9%ad%85%e5%8a%9b","status":"publish","type":"post","link":"https:\/\/www.yunshan.net\/blog\/archives\/10415.html","title":{"rendered":"\u6df1\u5165\u7814\u7a76Prometheus\u6280\u672f\u7279\u70b9\uff1a\u72ec\u7279\u800c\u5f3a\u5927\u7684\u9b45\u529b"},"content":{"rendered":"<p>\t\t\t\t<![CDATA[\n\n<p>\u6df1\u5165\u7814\u7a76<a href=\"https:\/\/www.yunshan.net\" target=\"_blank\" style=\"color:blue\" rel=\"noopener noreferrer\">Prometheus<\/a>\u6280\u672f\u7279\u70b9\uff1a\u72ec\u7279\u800c\u5f3a\u5927\u7684\u9b45\u529b<\/p>\n\n\n\n\n<p>\u5728\u5f53\u4eca\u6570\u5b57\u5316\u7684\u65f6\u4ee3\uff0c\u7f51\u7edc\u6d41\u91cf\u7684\u91c7\u96c6\u548c\u5206\u53d1\u5bf9\u4e8e\u4f01\u4e1a\u7684\u8fd0\u7ef4\u548c\u4e1a\u52a1\u53d1\u5c55\u81f3\u5173\u91cd\u8981\u3002\u800c\u5728\u4f17\u591a\u7684\u6280\u672f\u89e3\u51b3\u65b9\u6848\u4e2d\uff0c<a href=\"https:\/\/www.yunshan.net\" target=\"_blank\" style=\"color:blue\" rel=\"noopener noreferrer\">Prometheus<\/a>\u4ee5\u5176\u72ec\u7279\u800c\u5f3a\u5927\u7684\u7279\u70b9\uff0c\u6210\u4e3a\u4e86<a href=\"https:\/\/www.yunshan.net\" target=\"_blank\" style=\"color:blue\" rel=\"noopener noreferrer\">\u7f51\u7edc\u6d41\u91cf\u91c7\u96c6<\/a>\u5206\u53d1\u9886\u57df\u7684\u4e00\u9897\u7480\u74a8\u660e\u661f\u3002<\/p>\n\n\n\n<p align=center><img decoding=\"async\" src=\"https:\/\/www.yunshan.net\/blog\/wp-content\/uploads\/2024\/09\/VoiuNK9.jpg\" \/><\/p>\n\n\n\n\n<p>Prometheus\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u76d1\u63a7\u7cfb\u7edf\u548c\u65f6\u5e8f\u6570\u636e\u5e93\uff0c\u6700\u521d\u7531SoundCloud\u5f00\u53d1\u3002\u5b83\u5177\u6709\u8bb8\u591a\u4ee4\u4eba\u77a9\u76ee\u7684\u6280\u672f\u7279\u70b9\uff0c\u4f7f\u5176\u5728\u5904\u7406\u7f51\u7edc\u6d41\u91cf\u6570\u636e\u65b9\u9762\u8868\u73b0\u51fa\u8272\u3002<\/p>\n\n\n\n\n<p>\u9996\u5148\uff0cPrometheus\u91c7\u7528\u4e86\u57fa\u4e8e\u62c9\u53d6\uff08Pull\uff09\u7684\u6a21\u578b\u6765\u83b7\u53d6\u76d1\u63a7\u6570\u636e\u3002\u4e0e\u4f20\u7edf\u7684\u57fa\u4e8e\u63a8\u9001\uff08Push\uff09\u7684\u65b9\u5f0f\u4e0d\u540c\uff0cPrometheus\u4e3b\u52a8\u4ece\u88ab\u76d1\u63a7\u7684\u76ee\u6807\u4e2d\u62c9\u53d6\u6570\u636e\u3002\u8fd9\u79cd\u65b9\u5f0f\u8d4b\u4e88\u4e86\u7cfb\u7edf\u66f4\u5927\u7684\u7075\u6d3b\u6027\u548c\u53ef\u63a7\u6027\u3002\u5728<a href=\"https:\/\/www.yunshan.net\" target=\"_blank\" style=\"color:blue\" rel=\"noopener noreferrer\">\u7f51\u7edc\u6d41\u91cf\u91c7\u96c6<\/a>\u5206\u53d1\u4e2d\uff0c\u8fd9\u610f\u5473\u7740\u53ef\u4ee5\u66f4\u7cbe\u786e\u5730\u63a7\u5236\u6570\u636e\u91c7\u96c6\u7684\u9891\u7387\u548c\u65f6\u673a\uff0c\u786e\u4fdd\u83b7\u53d6\u5230\u6700\u53ca\u65f6\u548c\u51c6\u786e\u7684\u6d41\u91cf\u4fe1\u606f\u3002<\/p>\n\n\n\n\n<p>\u5176\u6b21\uff0cPrometheus\u5bf9\u65f6\u5e8f\u6570\u636e\u7684\u5904\u7406\u80fd\u529b\u975e\u5e38\u5f3a\u5927\u3002\u7f51\u7edc\u6d41\u91cf\u6570\u636e\u672c\u8d28\u4e0a\u662f\u4e00\u79cd\u65f6\u5e8f\u6570\u636e\uff0c\u5177\u6709\u968f\u7740\u65f6\u95f4\u53d8\u5316\u7684\u7279\u70b9\u3002Prometheus\u80fd\u591f\u9ad8\u6548\u5730\u5b58\u50a8\u548c\u67e5\u8be2\u5927\u91cf\u7684\u65f6\u5e8f\u6570\u636e\uff0c\u5e76\u4e14\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u67e5\u8be2\u8bed\u8a00PromQL\uff08PrometheusQueryLanguage\uff09\u3002\u901a\u8fc7PromQL\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u5bf9\u7f51\u7edc\u6d41\u91cf\u7684\u8d8b\u52bf\u3001\u5cf0\u503c\u3001\u5e73\u5747\u503c\u7b49\u8fdb\u884c\u5206\u6790\u548c\u8ba1\u7b97\uff0c\u5e2e\u52a9\u8fd0\u7ef4\u4eba\u5458\u5feb\u901f\u53d1\u73b0\u6f5c\u5728\u7684\u95ee\u9898\u548c\u5f02\u5e38\u3002<\/p>\n\n\n\n\n<p>\u518d\u8005\uff0cPrometheus\u5177\u6709\u826f\u597d\u7684\u6269\u5c55\u6027\u3002\u5b83\u652f\u6301\u901a\u8fc7Exporter\u6765\u6269\u5c55\u76d1\u63a7\u7684\u6570\u636e\u6e90\u3002\u5bf9\u4e8e\u7f51\u7edc\u6d41\u91cf\u91c7\u96c6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e13\u95e8\u7684\u7f51\u7edc\u6d41\u91cfExporter\u6765\u5c06\u6d41\u91cf\u6570\u636e\u8f6c\u5316\u4e3aPrometheus\u80fd\u591f\u7406\u89e3\u7684\u683c\u5f0f\u3002\u540c\u65f6\uff0cPrometheus\u8fd8\u53ef\u4ee5\u4e0e\u5176\u4ed6\u7cfb\u7edf\u8fdb\u884c\u96c6\u6210\uff0c\u5f62\u6210\u4e00\u4e2a\u66f4\u5b8c\u6574\u7684\u76d1\u63a7\u751f\u6001\u3002<\/p>\n\n\n\n\n<p>\u5728\u6570\u636e\u5b58\u50a8\u65b9\u9762\uff0cPrometheus\u91c7\u7528\u672c\u5730\u5b58\u50a8\uff0c\u5c06\u6570\u636e\u4ee5\u9ad8\u6548\u7684\u538b\u7f29\u683c\u5f0f\u4fdd\u5b58\u3002\u8fd9\u4e0d\u4ec5\u8282\u7701\u4e86\u5b58\u50a8\u7a7a\u95f4\uff0c\u8fd8\u63d0\u9ad8\u4e86\u6570\u636e\u8bfb\u53d6\u7684\u6548\u7387\u3002\u5bf9\u4e8e\u7f51\u7edc\u6d41\u91cf\u8fd9\u79cd\u5927\u91cf\u7684\u6570\u636e\uff0c\u9ad8\u6548\u7684\u5b58\u50a8\u548c\u8bfb\u53d6\u662f\u81f3\u5173\u91cd\u8981\u7684\uff0c\u80fd\u591f\u786e\u4fdd\u5728\u9700\u8981\u65f6\u5feb\u901f\u83b7\u53d6\u548c\u5206\u6790\u6570\u636e\u3002<\/p>\n\n\n\n\n<p>Prometheus\u7684\u544a\u8b66\u529f\u80fd\u4e5f\u5341\u5206\u51fa\u8272\u3002\u53ef\u4ee5\u6839\u636e\u8bbe\u5b9a\u7684\u89c4\u5219\u548c\u9608\u503c\uff0c\u5bf9\u7f51\u7edc\u6d41\u91cf\u7684\u5173\u952e\u6307\u6807\u8fdb\u884c\u76d1\u6d4b\uff0c\u5e76\u5728\u8fbe\u5230\u9608\u503c\u65f6\u53ca\u65f6\u53d1\u9001\u544a\u8b66\u901a\u77e5\u3002\u8fd9\u4f7f\u5f97\u8fd0\u7ef4\u4eba\u5458\u80fd\u591f\u5728\u7b2c\u4e00\u65f6\u95f4\u54cd\u5e94\u95ee\u9898\uff0c\u907f\u514d\u6f5c\u5728\u7684\u4e1a\u52a1\u5f71\u54cd\u3002<\/p>\n\n\n\n\n<p>\u53e6\u5916\uff0cPrometheus\u7684\u793e\u533a\u6d3b\u8dc3\u4e14\u5f3a\u5927\u3002\u5f00\u6e90\u793e\u533a\u4e0d\u65ad\u4e3a\u5176\u8d21\u732e\u65b0\u7684\u529f\u80fd\u3001\u4fee\u590d\u6f0f\u6d1e\u548c\u63d0\u4f9b\u6280\u672f\u652f\u6301\u3002\u8fd9\u610f\u5473\u7740\u5728\u4f7f\u7528Prometheus\u8fdb\u884c\u7f51\u7edc\u6d41\u91cf\u91c7\u96c6\u5206\u53d1\u65f6\uff0c\u53ef\u4ee5\u83b7\u5f97\u6700\u65b0\u7684\u6280\u672f\u66f4\u65b0\u548c\u89e3\u51b3\u65b9\u6848\uff0c\u964d\u4f4e\u4e86\u6280\u672f\u98ce\u9669\u3002<\/p>\n\n\n\n\n<p>\u7136\u800c\uff0cPrometheus\u4e5f\u5e76\u975e\u5b8c\u7f8e\u65e0\u7f3a\u3002\u5728\u5904\u7406\u5927\u89c4\u6a21\u7684\u7f51\u7edc\u6d41\u91cf\u6570\u636e\u65f6\uff0c\u53ef\u80fd\u4f1a\u9762\u4e34\u6027\u80fd\u6311\u6218\u3002\u4f46\u901a\u8fc7\u5408\u7406\u7684\u67b6\u6784\u8bbe\u8ba1\u548c\u4f18\u5316\uff0c\u5982\u4f7f\u7528\u8054\u90a6\uff08Federation\uff09\u3001\u5206\u5c42\u5b58\u50a8\u7b49\u6280\u672f\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u7f13\u89e3\u8fd9\u4e9b\u95ee\u9898\u3002<\/p>\n\n\n\n\n<p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4ee5\u4e91\u6749\u7f51\u7edc\u4e3a\u4f8b\uff0cPrometheus\u5728\u7f51\u7edc\u6d41\u91cf\u91c7\u96c6\u5206\u53d1\u65b9\u9762\u53d1\u6325\u4e86\u91cd\u8981\u4f5c\u7528\u3002\u4e91\u6749\u7f51\u7edc\u901a\u8fc7\u5229\u7528Prometheus\u7684\u6280\u672f\u7279\u70b9\uff0c\u5b9e\u73b0\u4e86\u5bf9\u7f51\u7edc\u6d41\u91cf\u7684\u5168\u9762\u3001\u5b9e\u65f6\u3001\u51c6\u786e\u7684\u91c7\u96c6\u548c\u5206\u6790\u3002<\/p>\n\n\n\n\n<p>\u4e91\u6749\u7f51\u7edc\u9996\u5148\u901a\u8fc7\u90e8\u7f72\u591a\u4e2a\u6570\u636e\u91c7\u96c6\u70b9\uff0c\u4f7f\u7528\u4e13\u95e8\u7684\u6d41\u91cf\u91c7\u96c6\u5de5\u5177\u5c06\u7f51\u7edc\u6d41\u91cf\u6570\u636e\u8f6c\u5316\u4e3aPrometheus\u53ef\u63a5\u53d7\u7684\u683c\u5f0f\u3002\u7136\u540e\uff0cPrometheus\u6309\u7167\u8bbe\u5b9a\u7684\u7b56\u7565\u4ece\u8fd9\u4e9b\u91c7\u96c6\u70b9\u62c9\u53d6\u6570\u636e\uff0c\u5e76\u8fdb\u884c\u5b58\u50a8\u548c\u5904\u7406\u3002<\/p>\n\n\n\n\n<p>\u901a\u8fc7Prometheus\u7684\u5f3a\u5927\u67e5\u8be2\u8bed\u8a00\u548c\u5206\u6790\u529f\u80fd\uff0c\u4e91\u6749\u7f51\u7edc\u80fd\u591f\u6df1\u5165\u6d1e\u5bdf\u7f51\u7edc\u6d41\u91cf\u7684\u884c\u4e3a\u6a21\u5f0f\uff0c\u8bc6\u522b\u5f02\u5e38\u6d41\u91cf\u548c\u6f5c\u5728\u7684\u5b89\u5168\u5a01\u80c1\u3002\u540c\u65f6\uff0c\u7ed3\u5408\u544a\u8b66\u673a\u5236\uff0c\u53ca\u65f6\u901a\u77e5\u76f8\u5173\u4eba\u5458\u91c7\u53d6\u63aa\u65bd\uff0c\u4fdd\u969c\u7f51\u7edc\u7684\u7a33\u5b9a\u548c\u5b89\u5168\u3002<\/p>\n\n\n\n\n<p>\u6b64\u5916\uff0c\u4e91\u6749\u7f51\u7edc\u8fd8\u5145\u5206\u5229\u7528\u4e86Prometheus\u7684\u6269\u5c55\u6027\uff0c\u4e0e\u5176\u4ed6\u76d1\u63a7\u7cfb\u7edf\u548c\u5de5\u5177\u8fdb\u884c\u96c6\u6210\uff0c\u5f62\u6210\u4e86\u4e00\u4e2a\u7edf\u4e00\u7684\u76d1\u63a7\u5e73\u53f0\u3002\u8fd9\u6837\uff0c\u4e0d\u4ec5\u80fd\u591f\u5168\u9762\u4e86\u89e3\u7f51\u7edc\u6d41\u91cf\u7684\u60c5\u51b5\uff0c\u8fd8\u80fd\u5c06\u5176\u4e0e\u5176\u4ed6\u7cfb\u7edf\u7684\u6307\u6807\u8fdb\u884c\u5173\u8054\u5206\u6790\uff0c\u4e3a\u4f18\u5316\u7f51\u7edc\u67b6\u6784\u548c\u63d0\u5347\u4e1a\u52a1\u6027\u80fd\u63d0\u4f9b\u6709\u529b\u652f\u6301\u3002<\/p>\n\n\n\n\n<p>\u603b\u7684\u6765\u8bf4\uff0cPrometheus\u4ee5\u5176\u72ec\u7279\u7684\u6280\u672f\u7279\u70b9\uff0c\u5728\u7f51\u7edc\u6d41\u91cf\u91c7\u96c6\u5206\u53d1\u9886\u57df\u5c55\u73b0\u51fa\u4e86\u5f3a\u5927\u7684\u9b45\u529b\u3002\u901a\u8fc7\u5408\u7406\u7684\u5e94\u7528\u548c\u4f18\u5316\uff0c\u7ed3\u5408\u50cf\u4e91\u6749\u7f51\u7edc\u8fd9\u6837\u7684\u521b\u65b0\u5b9e\u8df5\uff0c\u80fd\u591f\u4e3a\u4f01\u4e1a\u7684\u7f51\u7edc\u8fd0\u7ef4\u548c\u4e1a\u52a1\u53d1\u5c55\u63d0\u4f9b\u575a\u5b9e\u7684\u4fdd\u969c\uff0c\u52a9\u529b\u4f01\u4e1a\u5728\u6570\u5b57\u5316\u65f6\u4ee3\u4e2d\u7a33\u5065\u524d\u884c\u3002<\/p>\n\n\n\n\n<p>\u968f\u7740\u6280\u672f\u7684\u4e0d\u65ad\u53d1\u5c55\u548c\u521b\u65b0\uff0c\u76f8\u4fe1Prometheus\u5728\u672a\u6765\u7684\u7f51\u7edc\u6d41\u91cf\u7ba1\u7406\u4e2d\u5c06\u4f1a\u53d1\u6325\u66f4\u52a0\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u4e3a\u6211\u4eec\u5e26\u6765\u66f4\u591a\u7684\u60ca\u559c\u548c\u4ef7\u503c\u3002\u4f46\u540c\u65f6\uff0c\u6211\u4eec\u4e5f\u9700\u8981\u4e0d\u65ad\u63a2\u7d22\u548c\u6539\u8fdb\uff0c\u4ee5\u5e94\u5bf9\u65e5\u76ca\u590d\u6742\u7684\u7f51\u7edc\u73af\u5883\u548c\u4e1a\u52a1\u9700\u6c42\u3002<\/p>\n\n]]>\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\t\t\t\t<![CDATA[]]>\t\t<\/p>\n","protected":false},"author":5,"featured_media":10416,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10415","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-discussion"],"_links":{"self":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/posts\/10415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/comments?post=10415"}],"version-history":[{"count":0,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/posts\/10415\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/media\/10416"}],"wp:attachment":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/media?parent=10415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/categories?post=10415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/tags?post=10415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}