{"id":23076,"date":"2024-11-26T12:24:53","date_gmt":"2024-11-26T04:24:53","guid":{"rendered":"https:\/\/www.yunshan.net\/blog\/?p=23076"},"modified":"2024-11-26T12:24:53","modified_gmt":"2024-11-26T04:24:53","slug":"prometheus%e7%9b%91%e6%8e%a7%e7%bd%91%e7%bb%9c%e6%80%a7%e8%83%bd%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.yunshan.net\/blog\/archives\/23076.html","title":{"rendered":"Prometheus\u76d1\u63a7\u7f51\u7edc\u6027\u80fd\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\t\t\t\t<![CDATA[\n\n<p><a href=\"https:\/\/www.yunshan.net\" target=\"_blank\" style=\"color:blue\" rel=\"noopener noreferrer\">Prometheus<\/a>\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u76d1\u63a7\u548c\u544a\u8b66\u7cfb\u7edf\uff0c\u5e7f\u6cdb\u7528\u4e8e\u76d1\u63a7\u5e94\u7528\u7a0b\u5e8f\u548c\u57fa\u7840\u8bbe\u65bd\u7684\u6027\u80fd\u3002\u5b83\u4ee5\u5176\u5f3a\u5927\u7684\u6570\u636e\u6536\u96c6\u3001\u5b58\u50a8\u548c\u67e5\u8be2\u80fd\u529b\u800c\u95fb\u540d\uff0c\u7279\u522b\u9002\u7528\u4e8e\u76d1\u63a7\u7f51\u7edc\u6027\u80fd\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528<a href=\"https:\/\/www.yunshan.net\" target=\"_blank\" style=\"color:blue\" rel=\"noopener noreferrer\">Prometheus<\/a>\u76d1\u63a7\u7f51\u7edc\u6027\u80fd\uff0c\u5305\u62ec\u5176\u67b6\u6784\u3001\u5173\u952e\u7ec4\u4ef6\u3001\u914d\u7f6e\u65b9\u6cd5\u4ee5\u53ca\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n\n\n\n\n<h3>Prometheus\u67b6\u6784\u6982\u8ff0<\/h3>\n\n\n\n\n<p>\u5728\u6df1\u5165\u4e86\u89e3Prometheus\u76d1\u63a7\u7f51\u7edc\u6027\u80fd\u7684\u5177\u4f53\u65b9\u6cd5\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u4e86\u89e3Prometheus\u7684\u57fa\u672c\u67b6\u6784\u3002Prometheus\u7531\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u7ec4\u4ef6\u7ec4\u6210\uff1a<\/p>\n\n\n\n\n\n\n\n\n<p align=center><img decoding=\"async\" src=\"https:\/\/www.yunshan.net\/blog\/wp-content\/uploads\/2024\/11\/B69r8q.jpg\" width=1000><\/p>\n\n\n\n\n\n\n\n\n\n<ol>\n\n\n<li><strong>Prometheus Server<\/strong>\uff1a\u8d1f\u8d23\u6536\u96c6\u548c\u5b58\u50a8\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u3002<\/li>\n\n\n\n\n<li><strong>Exporter<\/strong>\uff1a\u5c06\u5404\u79cd\u6307\u6807\u66b4\u9732\u7ed9Prometheus Server\u7684\u4ee3\u7406\u3002<\/li>\n\n\n\n\n<li><strong>Pushgateway<\/strong>\uff1a\u7528\u4e8e\u63a8\u9001\u77ed\u671f\u4efb\u52a1\u7684\u6307\u6807\u3002<\/li>\n\n\n\n\n<li><strong>Alertmanager<\/strong>\uff1a\u5904\u7406\u544a\u8b66\u901a\u77e5\u3002<\/li>\n\n\n\n\n<li><strong>PromQL<\/strong>\uff1aPrometheus\u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u7528\u4e8e\u67e5\u8be2\u548c\u805a\u5408\u6570\u636e\u3002<\/li>\n\n\n<\/ol>\n\n\n\n\n<h3>\u76d1\u63a7\u7f51\u7edc\u6027\u80fd\u7684\u5173\u952e\u6307\u6807<\/h3>\n\n\n\n\n<p>\u76d1\u63a7\u7f51\u7edc\u6027\u80fd\u901a\u5e38\u6d89\u53ca\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u6307\u6807\uff1a<\/p>\n\n\n\n\n<ol>\n\n\n<li><strong>\u5e26\u5bbd\u4f7f\u7528\u7387<\/strong>\uff1a\u7f51\u7edc\u63a5\u53e3\u7684\u5165\u7ad9\u548c\u51fa\u7ad9\u6d41\u91cf\u3002<\/li>\n\n\n\n\n<li><strong>\u5ef6\u8fdf<\/strong>\uff1a\u6570\u636e\u5305\u4ece\u6e90\u5230\u76ee\u7684\u5730\u7684\u4f20\u8f93\u65f6\u95f4\u3002<\/li>\n\n\n\n\n<li><strong>\u4e22\u5305\u7387<\/strong>\uff1a\u6570\u636e\u5305\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u4e22\u5931\u7684\u6bd4\u4f8b\u3002<\/li>\n\n\n\n\n<li><strong>\u8fde\u63a5\u6570<\/strong>\uff1a\u5f53\u524d\u6d3b\u8dc3\u7684\u7f51\u7edc\u8fde\u63a5\u6570\u91cf\u3002<\/li>\n\n\n\n\n<li><strong>\u9519\u8bef\u7387<\/strong>\uff1a\u7f51\u7edc\u4f20\u8f93\u4e2d\u7684\u9519\u8bef\u6570\u91cf\u3002<\/li>\n\n\n<\/ol>\n\n\n\n\n<h3>\u4f7f\u7528Exporter\u6536\u96c6\u7f51\u7edc\u6307\u6807<\/h3>\n\n\n\n\n<p>Prometheus\u672c\u8eab\u4e0d\u76f4\u63a5\u6536\u96c6\u7f51\u7edc\u6307\u6807\uff0c\u800c\u662f\u901a\u8fc7Exporter\u6765\u5b9e\u73b0\u3002Exporter\u662f\u4e00\u79cd\u5c06\u5404\u79cd\u6307\u6807\u66b4\u9732\u4e3aPrometheus\u53ef\u4ee5\u6293\u53d6\u7684\u683c\u5f0f\u7684\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u7f51\u7edc\u76d1\u63a7Exporter\uff1a<\/p>\n\n\n\n\n<ol>\n\n\n<li><strong>Node Exporter<\/strong>\uff1a\u7528\u4e8e\u6536\u96c6\u4e3b\u673a\u7ea7\u522b\u7684\u6307\u6807\uff0c\u5305\u62ec\u7f51\u7edc\u63a5\u53e3\u7684\u5e26\u5bbd\u4f7f\u7528\u7387\u3001\u8fde\u63a5\u6570\u7b49\u3002<\/li>\n\n\n\n\n<li><strong>SNMP Exporter<\/strong>\uff1a\u7528\u4e8e\u901a\u8fc7SNMP\u534f\u8bae\u6536\u96c6\u7f51\u7edc\u8bbe\u5907\u7684\u6307\u6807\u3002<\/li>\n\n\n\n\n<li><strong>Blackbox Exporter<\/strong>\uff1a\u7528\u4e8e\u8fdb\u884c\u7f51\u7edc\u63a2\u6d4b\uff0c\u5982HTTP\u3001TCP\u3001ICMP\u7b49\u3002<\/li>\n\n\n<\/ol>\n\n\n\n\n<h4>\u5b89\u88c5\u548c\u914d\u7f6eNode Exporter<\/h4>\n\n\n\n\n<p>Node Exporter\u662f\u6700\u5e38\u7528\u7684Exporter\u4e4b\u4e00\uff0c\u53ef\u4ee5\u8f7b\u677e\u6536\u96c6\u4e3b\u673a\u7684\u7f51\u7edc\u6307\u6807\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5\u548c\u914d\u7f6eNode Exporter\u7684\u6b65\u9aa4\uff1a<\/p>\n\n\n\n\n<ol>\n\n\n<li>\n\n<p><strong>\u4e0b\u8f7d\u548c\u5b89\u88c5Node Exporter<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-sh\">wget https:\/\/github.com\/prometheus\/node_exporter\/releases\/download\/v1.3.1\/node_exporter-1.3.1.linux-amd64.tar.gz<br \/>\ntar -xzf node_exporter-1.3.1.linux-amd64.tar.gz<br \/>\ncd node_exporter-1.3.1.linux-amd64<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u542f\u52a8Node Exporter<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-sh\">.\/node_exporter<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u914d\u7f6ePrometheus Server<\/strong>\uff1a\u5728Prometheus\u7684\u914d\u7f6e\u6587\u4ef6<code>prometheus.yml<\/code>\u4e2d\u6dfb\u52a0Node Exporter\u7684\u6293\u53d6\u76ee\u6807\u3002<\/p>\n\n\n\n\n<pre><code class=\"language-yaml\">scrape_configs:<br \/>\n  - job_name: 'node_exporter'<br \/>\n    static_configs:<br \/>\n      - targets: ['&lt;node_exporter_host&gt;:9100']<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n<\/ol>\n\n\n\n\n<h4>\u5b89\u88c5\u548c\u914d\u7f6eSNMP Exporter<\/h4>\n\n\n\n\n<p>SNMP Exporter\u7528\u4e8e\u901a\u8fc7SNMP\u534f\u8bae\u6536\u96c6\u7f51\u7edc\u8bbe\u5907\u7684\u6307\u6807\uff0c\u9002\u7528\u4e8e\u76d1\u63a7\u8def\u7531\u5668\u3001\u4ea4\u6362\u673a\u7b49\u8bbe\u5907\u3002<\/p>\n\n\n\n\n<ol>\n\n\n<li>\n\n<p><strong>\u4e0b\u8f7d\u548c\u5b89\u88c5SNMP Exporter<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-sh\">wget https:\/\/github.com\/prometheus\/snmp_exporter\/releases\/download\/v0.20.0\/snmp_exporter-0.20.0.linux-amd64.tar.gz<br \/>\ntar -xzf snmp_exporter-0.20.0.linux-amd64.tar.gz<br \/>\ncd snmp_exporter-0.20.0.linux-amd64<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u914d\u7f6eSNMP Exporter<\/strong>\uff1a\u7f16\u8f91<code>snmp.yml<\/code>\u6587\u4ef6\uff0c\u6dfb\u52a0\u9700\u8981\u76d1\u63a7\u7684\u8bbe\u5907\u3002<\/p>\n\n\n\n\n<pre><code class=\"language-yaml\">scrape_configs:<br \/>\n  - job_name: 'snmp'<br \/>\n    static_configs:<br \/>\n      - targets: ['&lt;device_ip&gt;:161']<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u542f\u52a8SNMP Exporter<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-sh\">.\/snmp_exporter --config.file=snmp.yml<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u914d\u7f6ePrometheus Server<\/strong>\uff1a\u5728<code>prometheus.yml<\/code>\u4e2d\u6dfb\u52a0SNMP Exporter\u7684\u6293\u53d6\u76ee\u6807\u3002<\/p>\n\n\n\n\n<pre><code class=\"language-yaml\">scrape_configs:<br \/>\n  - job_name: 'snmp_exporter'<br \/>\n    static_configs:<br \/>\n      - targets: ['&lt;snmp_exporter_host&gt;:9116']<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n<\/ol>\n\n\n\n\n<h4>\u5b89\u88c5\u548c\u914d\u7f6eBlackbox Exporter<\/h4>\n\n\n\n\n<p>Blackbox Exporter\u7528\u4e8e\u8fdb\u884c\u7f51\u7edc\u63a2\u6d4b\uff0c\u53ef\u4ee5\u76d1\u63a7HTTP\u3001TCP\u3001ICMP\u7b49\u534f\u8bae\u7684\u54cd\u5e94\u65f6\u95f4\u548c\u53ef\u7528\u6027\u3002<\/p>\n\n\n\n\n<ol>\n\n\n<li>\n\n<p><strong>\u4e0b\u8f7d\u548c\u5b89\u88c5Blackbox Exporter<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-sh\">wget https:\/\/github.com\/prometheus\/blackbox_exporter\/releases\/download\/v0.18.0\/blackbox_exporter-0.18.0.linux-amd64.tar.gz<br \/>\ntar -xzf blackbox_exporter-0.18.0.linux-amd64.tar.gz<br \/>\ncd blackbox_exporter-0.18.0.linux-amd64<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u914d\u7f6eBlackbox Exporter<\/strong>\uff1a\u7f16\u8f91<code>blackbox.yml<\/code>\u6587\u4ef6\uff0c\u6dfb\u52a0\u9700\u8981\u63a2\u6d4b\u7684\u76ee\u6807\u3002<\/p>\n\n\n\n\n<pre><code class=\"language-yaml\">modules:<br \/>\n  http_2xx:<br \/>\n    prober: http<br \/>\n    timeout: 5s<br \/>\n    http:<br \/>\n      valid_status_codes: [200, 201, 202, 203, 204, 205, 206]<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u542f\u52a8Blackbox Exporter<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-sh\">.\/blackbox_exporter --config.file=blackbox.yml<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u914d\u7f6ePrometheus Server<\/strong>\uff1a\u5728<code>prometheus.yml<\/code>\u4e2d\u6dfb\u52a0Blackbox Exporter\u7684\u6293\u53d6\u76ee\u6807\u3002<\/p>\n\n\n\n\n<pre><code class=\"language-yaml\">scrape_configs:<br \/>\n  - job_name: 'blackbox'<br \/>\n    metrics_path: \/probe<br \/>\n    params:<br \/>\n      module: [http_2xx]<br \/>\n    static_configs:<br \/>\n      - targets:<br \/>\n        - 'http:\/\/example.com'<br \/>\n    relabel_configs:<br \/>\n      - source_labels: [__address__]<br \/>\n        target_label: __param_target<br \/>\n      - source_labels: [__param_target]<br \/>\n        target_label: instance<br \/>\n      - target_label: __address__<br \/>\n        replacement: '&lt;blackbox_exporter_host&gt;:9115'<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n<\/ol>\n\n\n\n\n<h3>\u4f7f\u7528PromQL\u67e5\u8be2\u7f51\u7edc\u6307\u6807<\/h3>\n\n\n\n\n<p>Prometheus\u7684\u67e5\u8be2\u8bed\u8a00PromQL\u975e\u5e38\u5f3a\u5927\uff0c\u53ef\u4ee5\u7528\u4e8e\u67e5\u8be2\u548c\u805a\u5408\u7f51\u7edc\u6307\u6807\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684PromQL\u67e5\u8be2\u793a\u4f8b\uff1a<\/p>\n\n\n\n\n<ol>\n\n\n<li>\n\n<p><strong>\u67e5\u8be2\u7f51\u7edc\u63a5\u53e3\u7684\u5165\u7ad9\u6d41\u91cf<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-promql\">rate(node_network_receive_bytes_total{device=&quot;eth0&quot;}[5m])<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u67e5\u8be2\u7f51\u7edc\u63a5\u53e3\u7684\u51fa\u7ad9\u6d41\u91cf<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-promql\">rate(node_network_transmit_bytes_total{device=&quot;eth0&quot;}[5m])<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u67e5\u8be2\u7f51\u7edc\u5ef6\u8fdf<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-promql\">blackboxProbeDurationSeconds{job=&quot;blackbox&quot;, instance=&quot;http:\/\/example.com&quot;}<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u67e5\u8be2\u4e22\u5305\u7387<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-promql\">snmp_if_out_errors{ifDescr=&quot;eth0&quot;} \/ snmp_if_out_ucast_pkts{ifDescr=&quot;eth0&quot;}<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u67e5\u8be2\u6d3b\u8dc3\u8fde\u63a5\u6570<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-promql\">node_netstat_Tcp_CurrEstab<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n<\/ol>\n\n\n\n\n<h3>\u914d\u7f6e\u544a\u8b66\u89c4\u5219<\/h3>\n\n\n\n\n<p>Prometheus\u7684Alertmanager\u7ec4\u4ef6\u7528\u4e8e\u5904\u7406\u544a\u8b66\u901a\u77e5\u3002\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u544a\u8b66\u89c4\u5219\u6765\u53ca\u65f6\u53d1\u73b0\u7f51\u7edc\u6027\u80fd\u95ee\u9898\u3002<\/p>\n\n\n\n\n<ol>\n\n\n<li>\n\n<p><strong>\u7f16\u8f91\u544a\u8b66\u89c4\u5219\u6587\u4ef6<\/strong>\uff1a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>alerting_rules.yml<\/code>\u7684\u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\u3002<\/p>\n\n\n\n\n<pre><code class=\"language-yaml\">groups:<br \/>\n  - name: network_alerts<br \/>\n    rules:<br \/>\n      - alert: HighNetworkTraffic<br \/>\n        expr: rate(node_network_receive_bytes_total{device=&quot;eth0&quot;}[5m]) &gt; 10000000<br \/>\n        for: 1m<br \/>\n        labels:<br \/>\n          severity: warning<br \/>\n        annotations:<br \/>\n          summary: &quot;High network traffic detected&quot;<br \/>\n          description: &quot;Network interface eth0 is receiving more than 10MB\/s for the last 1 minute.&quot;<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u914d\u7f6ePrometheus Server<\/strong>\uff1a\u5728<code>prometheus.yml<\/code>\u4e2d\u6dfb\u52a0\u544a\u8b66\u89c4\u5219\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/p>\n\n\n\n\n<pre><code class=\"language-yaml\">rule_files:<br \/>\n  - 'alerting_rules.yml'<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u914d\u7f6eAlertmanager<\/strong>\uff1a\u7f16\u8f91<code>alertmanager.yml<\/code>\u6587\u4ef6\uff0c\u6dfb\u52a0\u544a\u8b66\u901a\u77e5\u7684\u63a5\u6536\u8005\u3002<\/p>\n\n\n\n\n<pre><code class=\"language-yaml\">global:<br \/>\n  resolve_timeout: 5m<br \/>\nroute:<br \/>\n  group_by: ['alertname']<br \/>\n  receiver: 'webhook'<br \/>\nreceivers:<br \/>\n  - name: 'webhook'<br \/>\n    webhook_configs:<br \/>\n      - url: 'http:\/\/example.com\/alert'<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n\n\n<li>\n\n<p><strong>\u542f\u52a8Alertmanager<\/strong>\uff1a<\/p>\n\n\n\n\n<pre><code class=\"language-sh\">.\/alertmanager --config.file=alertmanager.yml<br \/>\n<\/code><\/pre>\n\n\n<\/li>\n\n\n<\/ol>\n\n\n\n\n<h3>\u6700\u4f73\u5b9e\u8df5<\/h3>\n\n\n\n\n<ol>\n\n\n<li><strong>\u5408\u7406\u9009\u62e9Exporter<\/strong>\uff1a\u6839\u636e\u76d1\u63a7\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684Exporter\uff0c\u907f\u514d\u8fc7\u5ea6\u76d1\u63a7\u3002<\/li>\n\n\n\n\n<li><strong>\u4f18\u5316\u6293\u53d6\u95f4\u9694<\/strong>\uff1a\u6839\u636e\u6307\u6807\u7684\u91cd\u8981\u6027\u548c\u53d8\u5316\u9891\u7387\u8c03\u6574\u6293\u53d6\u95f4\u9694\uff0c\u907f\u514d\u8fc7\u5ea6\u8d1f\u8f7d\u3002<\/li>\n\n\n\n\n<li><strong>\u4f7f\u7528\u6301\u4e45\u5316\u5b58\u50a8<\/strong>\uff1a\u914d\u7f6ePrometheus\u4f7f\u7528\u6301\u4e45\u5316\u5b58\u50a8\uff0c\u5982Thanos\u6216Cortex\uff0c\u4ee5\u4fdd\u7559\u5386\u53f2\u6570\u636e\u3002<\/li>\n\n\n\n\n<li><strong>\u5b9a\u671f\u5ba1\u67e5\u544a\u8b66\u89c4\u5219<\/strong>\uff1a\u5b9a\u671f\u5ba1\u67e5\u548c\u4f18\u5316\u544a\u8b66\u89c4\u5219\uff0c\u907f\u514d\u8bef\u62a5\u548c\u6f0f\u62a5\u3002<\/li>\n\n\n\n\n<li><strong>\u53ef\u89c6\u5316\u76d1\u63a7\u6570\u636e<\/strong>\uff1a\u4f7f\u7528Grafana\u7b49\u5de5\u5177\u53ef\u89c6\u5316\u76d1\u63a7\u6570\u636e\uff0c\u4fbf\u4e8e\u5feb\u901f\u8bc6\u522b\u95ee\u9898\u3002<\/li>\n\n\n<\/ol>\n\n\n\n\n<h3>\u7ed3\u8bba<\/h3>\n\n\n\n\n<p>Prometheus\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u76d1\u63a7\u5de5\u5177\uff0c\u901a\u8fc7\u5408\u7406\u914d\u7f6e\u548c\u4f7f\u7528Exporter\u3001PromQL\u4ee5\u53caAlertmanager\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u76d1\u63a7\u7f51\u7edc\u6027\u80fd\u3002\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86Prometheus\u7684\u67b6\u6784\u3001\u5173\u952e\u7ec4\u4ef6\u3001\u914d\u7f6e\u65b9\u6cd5\u4ee5\u53ca\u6700\u4f73\u5b9e\u8df5\uff0c\u5e2e\u52a9\u8bfb\u8005\u6784\u5efa\u4e00\u4e2a\u9ad8\u6548\u7684\u7f51\u7edc\u76d1\u63a7\u7cfb\u7edf\u3002\u901a\u8fc7\u6301\u7eed\u76d1\u63a7\u548c\u4f18\u5316\uff0c\u53ef\u4ee5\u786e\u4fdd\u7f51\u7edc\u7684\u9ad8\u53ef\u7528\u6027\u548c\u9ad8\u6027\u80fd\uff0c\u63d0\u5347\u6574\u4f53\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u3002<\/p>\n\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":23077,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-23076","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\/23076","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=23076"}],"version-history":[{"count":0,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/posts\/23076\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/media\/23077"}],"wp:attachment":[{"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/media?parent=23076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/categories?post=23076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yunshan.net\/blog\/wp-json\/wp\/v2\/tags?post=23076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}