{"id":1556,"date":"2023-03-25T15:46:51","date_gmt":"2023-03-25T07:46:51","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1556"},"modified":"2023-04-27T21:37:17","modified_gmt":"2023-04-27T13:37:17","slug":"prometheus-grafana-using-elasticsearch-exporter-monitoring-elasticsearch","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/prometheus-grafana-using-elasticsearch-exporter-monitoring-elasticsearch\/","title":{"rendered":"Prometheus + Grafana \u4f7f\u7528 elasticsearch_exporter \u76d1\u63a7 ElasticSearch"},"content":{"rendered":"<p>Prometheus Exporters\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/prometheus.io\/docs\/instrumenting\/exporters\/\">https:\/\/prometheus.io\/docs\/instrumenting\/exporters\/<\/a><br \/>\nelasticsearch_exporter\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/justwatchcom\/elasticsearch_exporter\">https:\/\/github.com\/justwatchcom\/elasticsearch_exporter<\/a><br \/>\nGrafana Dashboard\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/grafana.com\/grafana\/dashboards\/2322\">https:\/\/grafana.com\/grafana\/dashboards\/2322<\/a><\/p>\n<h2>\u521b\u5efa Elasticsearch Data Sources<\/h2>\n<p><!-- more --><\/p>\n<pre><code>No date field named @timestamp found<\/code><\/pre>\n<p>\u7248\u672c\u95ee\u9898\uff1a<code>Version<\/code>\u6539\u4e3a<code>7.0+<\/code>\u5373\u53ef<\/p>\n<h2>elasticsearch_exporter\u90e8\u7f72<\/h2>\n<pre><code># tar -zxf elasticsearch_exporter-1.1.0rc1.linux-amd64.tar.gz -C \/usr\/local\/\n# mv \/usr\/local\/elasticsearch_exporter-1.1.0rc1.linux-amd64 \/usr\/local\/elasticsearch_exporter\n# cd \/usr\/local\/elasticsearch_exporter\/\n# nohup .\/elasticsearch_exporter --web.listen-address &quot;0.0.0.0:9108&quot; --es.uri http:\/\/192.168.165.239:9200 &amp;\n# nohup .\/elasticsearch_exporter --web.listen-address &quot;0.0.0.0:9108&quot; --es.uri http:\/\/elastic:******@192.168.165.239:9200 &amp;\n# curl localhost:9108\/metrics<\/code><\/pre>\n<h2>Prometheus\u914d\u7f6e<\/h2>\n<pre><code class=\"language-yml\">- job_name: elasticsearch\n  metrics_path: &quot;\/metrics&quot;\n  static_configs:\n    - targets: [&#039;192.168.165.239:9108&#039;]\n      labels:\n        instance: elasticsearch\n        group: inner<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Prometheus Exporters\uff1ahttps:\/\/prometheus.io\/docs\/instrum [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[386],"tags":[385,387],"class_list":["post-1556","post","type-post","status-publish","format-standard","hentry","category-monitor","tag-grafana","tag-prometheus"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1556"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1556\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}