{"id":423905,"date":"2024-12-03T23:45:43","date_gmt":"2024-12-03T15:45:43","guid":{"rendered":"https:\/\/www.idc.net\/help\/423905\/"},"modified":"2024-12-03T23:45:43","modified_gmt":"2024-12-03T15:45:43","slug":"docker%e4%b8%8eprometheus%e7%bb%93%e5%90%88%e5%ae%9e%e7%8e%b0%e5%ae%b9%e5%99%a8%e8%b5%84%e6%ba%90%e7%9a%84%e5%85%a8%e9%9d%a2%e7%9b%91%e6%8e%a7","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/423905\/","title":{"rendered":"Docker\u4e0ePrometheus\u7ed3\u5408\u5b9e\u73b0\u5bb9\u5668\u8d44\u6e90\u7684\u5168\u9762\u76d1\u63a7"},"content":{"rendered":"<h1 id=\"docker%e4%b8%8eprometheus%e7%bb%93%e5%90%88%e5%ae%9e%e7%8e%b0%e5%ae%b9%e5%99%a8%e8%b5%84%e6%ba%90%e7%9a%84%e5%85%a8%e9%9d%a2%e7%9b%91%e6%8e%a7-sdYglFzTPm\">Docker\u4e0ePrometheus\u7ed3\u5408\u5b9e\u73b0\u5bb9\u5668\u8d44\u6e90\u7684\u5168\u9762\u76d1\u63a7<\/h1>\n<p>\u5728\u73b0\u4ee3\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u5bb9\u5668\u5316\u6280\u672f\u5df2\u7ecf\u6210\u4e3a\u4e00\u79cd\u4e3b\u6d41\u7684\u5e94\u7528\u90e8\u7f72\u65b9\u5f0f\u3002Docker\u4f5c\u4e3a\u6700\u6d41\u884c\u7684\u5bb9\u5668\u5316\u5e73\u53f0\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u5c06\u5e94\u7528\u53ca\u5176\u4f9d\u8d56\u6253\u5305\u5728\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u5bb9\u5668\u4e2d\uff0c\u4ece\u800c\u5b9e\u73b0\u5feb\u901f\u90e8\u7f72\u548c\u6269\u5c55\u3002\u7136\u800c\uff0c\u968f\u7740\u5bb9\u5668\u6570\u91cf\u7684\u589e\u52a0\uff0c\u5982\u4f55\u6709\u6548\u76d1\u63a7\u8fd9\u4e9b\u5bb9\u5668\u7684\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\u6210\u4e3a\u4e86\u4e00\u4e2a\u91cd\u8981\u7684\u8bfe\u9898\u3002Prometheus\u4f5c\u4e3a\u4e00\u4e2a\u5f00\u6e90\u7684\u76d1\u63a7\u7cfb\u7edf\uff0c\u80fd\u591f\u4e0eDocker\u65e0\u7f1d\u96c6\u6210\uff0c\u4e3a\u5bb9\u5668\u63d0\u4f9b\u5168\u9762\u7684\u76d1\u63a7\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<h2 id=\"docker%e4%b8%8eprometheus%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%a6%82%e5%bf%b5-sdYglFzTPm\">Docker\u4e0ePrometheus\u7684\u57fa\u672c\u6982\u5ff5<\/h2>\n<p>Docker\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5bb9\u5668\u5316\u5e73\u53f0\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u5728\u4e0d\u540c\u7684\u73af\u5883\u4e2d\u8fd0\u884c\u5e94\u7528\u3002\u5b83\u901a\u8fc7\u5c06\u5e94\u7528\u53ca\u5176\u4f9d\u8d56\u6253\u5305\u5728\u4e00\u4e2a\u72ec\u7acb\u7684\u5bb9\u5668\u4e2d\uff0c\u89e3\u51b3\u4e86\u201c\u5728\u6211\u7535\u8111\u4e0a\u53ef\u4ee5\u8fd0\u884c\u201d\u7684\u95ee\u9898\u3002<\/p>\n<p>Prometheus\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u76d1\u63a7\u548c\u62a5\u8b66\u5de5\u5177\uff0c\u4e13\u4e3a\u4e91\u539f\u751f\u5e94\u7528\u8bbe\u8ba1\u3002\u5b83\u4f7f\u7528\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u5e93\u6765\u5b58\u50a8\u76d1\u63a7\u6570\u636e\uff0c\u5e76\u63d0\u4f9b\u5f3a\u5927\u7684\u67e5\u8be2\u8bed\u8a00\uff08PromQL\uff09\u6765\u5206\u6790\u8fd9\u4e9b\u6570\u636e\u3002Prometheus\u7684\u4e3b\u8981\u7279\u70b9\u5305\u62ec\u591a\u7ef4\u6570\u636e\u6a21\u578b\u3001\u7075\u6d3b\u7684\u67e5\u8be2\u8bed\u8a00\u548c\u5f3a\u5927\u7684\u62a5\u8b66\u529f\u80fd\u3002<\/p>\n<h2 id=\"docker%e4%b8%8eprometheus%e7%9a%84%e9%9b%86%e6%88%90-sdYglFzTPm\">Docker\u4e0ePrometheus\u7684\u96c6\u6210<\/h2>\n<p>\u8981\u5b9e\u73b0Docker\u4e0ePrometheus\u7684\u96c6\u6210\uff0c\u9996\u5148\u9700\u8981\u5728Docker\u5bb9\u5668\u4e2d\u8fd0\u884cPrometheus\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u6b65\u9aa4\u6307\u5357\uff1a<\/p>\n<h3 id=\"1-%e5%ae%89%e8%a3%85docker-sdYglFzTPm\">1. \u5b89\u88c5Docker<\/h3>\n<pre><code>sudo apt-get update\nsudo apt-get install docker.io<\/code><\/pre>\n<h3 id=\"2-%e5%88%9b%e5%bb%baprometheus%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6-sdYglFzTPm\">2. \u521b\u5efaPrometheus\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u5728\u672c\u5730\u521b\u5efa\u4e00\u4e2a\u540d\u4e3aprometheus.yml\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre><code>global:<br \/>\n  scrape_interval::<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u5982\u4f55\u5c06Docker\u4e0ePrometheus\u7ed3\u5408\uff0c\u5b9e\u73b0\u5bf9\u5bb9\u5668\u8d44\u6e90\u7684\u5168\u9762\u76d1\u63a7\uff0c\u63d0\u5347\u7cfb\u7edf\u6027\u80fd\u4e0e\u53ef\u89c6\u5316\u7ba1\u7406\u80fd\u529b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202757],"tags":[],"class_list":["post-423905","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/423905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=423905"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/423905\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=423905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=423905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=423905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}