\u76d1\u63a7<\/a>\u6846\u67b6\uff0cPrometheus \u5177\u6709\u4ee5\u4e0b\u7279\u70b9\uff1a<\/p>\n\n\n\n\u5f3a\u5927\u7684\u591a\u7ef4\u5ea6\u6570\u636e\u6a21\u578b\uff1a \u65f6\u95f4\u5e8f\u5217\u6570\u636e\u901a\u8fc7 metric \u540d\u548c\u952e\u503c\u5bf9\u6765\u533a\u5206\u3002 \u6240\u6709\u7684 metrics \u90fd\u53ef\u4ee5\u8bbe\u7f6e\u4efb\u610f\u7684\u591a\u7ef4\u6807\u7b7e\u3002
\u6570\u636e\u6a21\u578b\u66f4\u968f\u610f\uff0c\u4e0d\u9700\u8981\u523b\u610f\u8bbe\u7f6e\u4e3a\u4ee5\u70b9\u5206\u9694\u7684\u5b57\u7b26\u4e32\u3002 \u53ef\u4ee5\u5bf9\u6570\u636e\u6a21\u578b\u8fdb\u884c\u805a\u5408\uff0c\u5207\u5272\u548c\u5207\u7247\u64cd\u4f5c\u3002
\u652f\u6301\u53cc\u7cbe\u5ea6\u6d6e\u70b9\u7c7b\u578b\uff0c\u6807\u7b7e\u53ef\u4ee5\u8bbe\u4e3a\u5168unicode\u3002 \u7075\u6d3b\u800c\u5f3a\u5927\u7684\u67e5\u8be2\u8bed\u53e5\uff08PromQL\uff09\uff1a\u5728\u540c\u4e00\u4e2a\u67e5\u8be2\u8bed\u53e5\uff0c\u53ef\u4ee5\u5bf9\u591a\u4e2a metrics\u8fdb\u884c\u4e58\u6cd5\u3001\u52a0\u6cd5\u3001\u8fde\u63a5\u3001\u53d6\u5206\u6570\u4f4d\u7b49\u64cd\u4f5c\u3002
\u6613\u4e8e\u7ba1\u7406\uff1a Prometheus server\u662f\u4e00\u4e2a\u5355\u72ec\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c\u53ef\u76f4\u63a5\u5728\u672c\u5730\u5de5\u4f5c\uff0c\u4e0d\u4f9d\u8d56\u4e8e\u5206\u5e03\u5f0f\u5b58\u50a8\u3002 \u9ad8\u6548\uff1a\u5e73\u5747\u6bcf\u4e2a\u91c7\u6837\u70b9\u4ec5\u5360 3.5 bytes\uff0c\u4e14\u4e00\u4e2a Prometheus server \u53ef\u4ee5\u5904\u7406\u6570\u767e\u4e07\u7684 metrics\u3002 \u4f7f\u7528 pull\u6a21\u5f0f\u91c7\u96c6\u65f6\u95f4\u5e8f\u5217\u6570\u636e\uff0c\u8fd9\u6837\u4e0d\u4ec5\u6709\u5229\u4e8e\u672c\u673a\u6d4b\u8bd5\u800c\u4e14\u53ef\u4ee5\u907f\u514d\u6709\u95ee\u9898\u7684\u670d\u52a1\u5668\u63a8\u9001\u574f\u7684 metrics\u3002 \u53ef\u4ee5\u91c7\u7528 push gateway \u7684\u65b9\u5f0f\u628a\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u63a8\u9001\u81f3 Prometheus server \u7aef\u3002 \u53ef\u4ee5\u901a\u8fc7\u670d\u52a1\u53d1\u73b0\u6216\u8005\u9759\u6001\u914d\u7f6e\u53bb\u83b7\u53d6\u76d1\u63a7\u7684 targets\u3002
\u6709\u591a\u79cd\u53ef\u89c6\u5316\u56fe\u5f62\u754c\u9762\u3002 \u6613\u4e8e\u4f38\u7f29\u3002 \u9700\u8981\u6307\u51fa\u7684\u662f\uff0c\u7531\u4e8e\u6570\u636e\u91c7\u96c6\u53ef\u80fd\u4f1a\u6709\u4e22\u5931\uff0c\u6240\u4ee5 Prometheus \u4e0d\u9002\u7528\u5bf9\u91c7\u96c6\u6570\u636e\u8981 100%
\u51c6\u786e\u7684\u60c5\u5f62\u3002\u4f46\u5982\u679c\u7528\u4e8e\u8bb0\u5f55\u65f6\u95f4\u5e8f\u5217\u6570\u636e\uff0cPrometheus \u5177\u6709\u5f88\u5927\u7684\u67e5\u8be2\u4f18\u52bf\uff0c\u6b64\u5916\uff0cPrometheus \u9002\u7528\u4e8e\u5fae\u670d\u52a1\u7684\u4f53\u7cfb\u67b6\u6784\u3002<\/p>\n\n\n\n
\u7ec4\u4ef6<\/h2>\n\n\n\n
Prometheus\u751f\u6001\u7cfb\u7edf\u7531\u591a\u4e2a\u7ec4\u4ef6\u7ec4\u6210\uff0c\u5176\u4e2d\u8bb8\u591a\u7ec4\u4ef6\u662f\u53ef\u9009\u7684\uff1a<\/p>\n\n\n\n
\u4e3b\u8981\u7684Prometheus\u670d\u52a1\u5668\uff0c\u7528\u4e8e\u5b58\u50a8\u65f6\u95f4\u5e8f\u5217\u6570\u636e \uff1b<\/p>\n\n\n\n
\u7528\u4e8e\u68c0\u6d4b\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u7684\u5ba2\u6237\u7aef\u5e93\uff1b<\/p>\n\n\n\n
\u7528\u4e8e\u652f\u6301\u77ed\u671f\u5de5\u4f5c\u7684\u63a8\u9001\u7f51\u5173 \u9488\u5bf9HAProxy\uff0cStatsD\uff0cGraphite\u7b49\u670d\u52a1\u7684\u4e13\u7528\u51fa\u53e3\u5546 \uff1b<\/p>\n\n\n\n
\u4e00\u4e2aalertmanager\u5904\u7406\u8b66\u62a5 \u5404\u79cd\u652f\u6301\u5de5\u5177 \uff1b<\/p>\n\n\n\n
\u5927\u591a\u6570Prometheus\u7ec4\u4ef6\u90fd\u662f\u7528Go\u7f16\u5199\u7684\uff0c\u56e0\u6b64\u5f88\u5bb9\u6613\u6784\u5efa\u548c\u90e8\u7f72\u4e3a\u9759\u6001\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002 <\/p>\n\n\n\n
\u67b6\u6784<\/h2>\n\n\n\n
\u6b64\u56fe\u8bf4\u660e\u4e86Prometheus\u7684\u4f53\u7cfb\u7ed3\u6784\u53ca\u5176\u4e00\u4e9b\u751f\u6001\u7cfb\u7edf\u7ec4\u4ef6\uff1a<\/p>\n\n\n\n