{"id":13615963,"url":"https://github.com/vvanholl/elasticsearch-prometheus-exporter","last_synced_at":"2025-04-14T00:31:22.888Z","repository":{"id":10116391,"uuid":"64279630","full_name":"vvanholl/elasticsearch-prometheus-exporter","owner":"vvanholl","description":"Prometheus exporter plugin for Elasticsearch","archived":false,"fork":false,"pushed_at":"2024-01-16T09:23:22.000Z","size":523,"stargazers_count":486,"open_issues_count":38,"forks_count":137,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-08-02T20:47:40.850Z","etag":null,"topics":["elasticsearch","plugin","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vvanholl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-27T05:27:30.000Z","updated_at":"2024-06-15T09:27:56.000Z","dependencies_parsed_at":"2024-05-28T17:14:30.517Z","dependency_job_id":"62966299-22e1-4fbb-b2cb-a4a796865981","html_url":"https://github.com/vvanholl/elasticsearch-prometheus-exporter","commit_stats":null,"previous_names":[],"tags_count":162,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanholl%2Felasticsearch-prometheus-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanholl%2Felasticsearch-prometheus-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanholl%2Felasticsearch-prometheus-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vvanholl%2Felasticsearch-prometheus-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vvanholl","download_url":"https://codeload.github.com/vvanholl/elasticsearch-prometheus-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223611619,"owners_count":17173478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","plugin","prometheus"],"created_at":"2024-08-01T20:01:21.357Z","updated_at":"2024-11-08T00:30:25.076Z","avatar_url":"https://github.com/vvanholl.png","language":"Java","funding_links":[],"categories":["Java","others","Elasticsearch"],"sub_categories":["Tools"],"readme":"![CI](https://github.com/vvanholl/elasticsearch-prometheus-exporter/workflows/CI/badge.svg?branch=master)\n\n# Prometheus Exporter Plugin for Elasticsearch\n\nThis is a builtin exporter from Elasticsearch to Prometheus.\nIt collects all relevant metrics and makes them available to Prometheus via the Elasticsearch REST API.\n\n**Currently, the available metrics are:**\n\n- Cluster status\n- Nodes status:\n    - JVM\n    - Indices (global)\n    - Transport\n    - HTTP\n    - Scripts\n    - Process\n    - Operating System\n    - File System\n    - Circuit Breaker\n- Indices status\n- Cluster settings (selected [disk allocation settings](https://www.elastic.co/guide/en/elasticsearch/reference/master/disk-allocator.html) only)\n\n## Compatibility matrix\n\n### Version 7.X\n\n| Elasticsearch  | Plugin         | Release date |\n| -------------- | -------------- | ------------ |\n| 7.17.7         | 7.17.7.0       | Oct 26, 2022 |\n| 7.17.6         | 7.17.6.0       | Aug 31, 2022 |\n| 7.17.5         | 7.17.5.0       | Jul 06, 2022 |\n| 7.17.4         | 7.17.4.0       | May 24, 2022 |\n| 7.17.3         | 7.17.3.0       | Apr 22, 2022 |\n| 7.17.2         | 7.17.2.0       | Apr 08, 2022 |\n| 7.17.1         | 7.17.1.0       | Mar 11, 2022 |\n| 7.17.0         | 7.17.0.0       | Feb 01, 2022 |\n| 7.16.3         | 7.16.3.0       | Jan 14, 2022 |\n| 7.16.2         | 7.16.2.0       | Dec 20, 2021 |\n| 7.16.1         | 7.16.1.0       | Dec 13, 2021 |\n| 7.16.0         | 7.16.0.0       | Dec 09, 2021 |\n| 7.15.2         | 7.15.2.0       | Nov 13, 2021 |\n| 7.15.1         | 7.15.1.0       | Oct 16, 2021 |\n| 7.15.0         | 7.15.0.0       | Oct 02, 2021 |\n| 7.14.1         | 7.14.1.0       | Sep 04, 2021 |\n| 7.14.0         | 7.14.0.0       | Aug 07, 2021 |\n| 7.13.4         | 7.13.4.0       | Jul 21, 2021 |\n| 7.13.3         | 7.13.3.0       | Jul 07, 2021 |\n| 7.13.2         | 7.13.2.0       | Jun 15, 2021 |\n| 7.13.1         | 7.13.1.0       | Jun 12, 2021 |\n| 7.13.0         | 7.13.0.0       | May 27, 2021 |\n| 7.12.1         | 7.12.1.0       | May 01, 2021 |\n| 7.12.0         | 7.12.0.0       | Apr 04, 2021 |\n| 7.11.2         | 7.11.2.0       | Mar 20, 2021 |\n| 7.11.1         | 7.11.1.0       | Feb 22, 2021 |\n| 7.10.2         | 7.10.2.0       | Jan 24, 2021 |\n| 7.10.1         | 7.10.1.0       | Dec 13, 2020 |\n| 7.10.0         | 7.10.0.0       | Nov 15, 2020 |\n| 7.9.3          | 7.9.3.0        | Oct 22, 2020 |\n| 7.9.2          | 7.9.2.0        | Oct 04, 2020 |\n| 7.9.1          | 7.9.1.0        | Sep 06, 2020 |\n| 7.9.0          | 7.9.0.0        | Aug 18, 2020 |\n| 7.8.1          | 7.8.1.0        | Aug 10, 2020 |\n| 7.8.0          | 7.8.0.0        | Jun 22, 2020 |\n| 7.7.1          | 7.7.1.0        | Jun 04, 2020 |\n| 7.7.0          | 7.7.0.0        | May 14, 2020 |\n| 7.6.2          | 7.6.2.0        | Apr 06, 2020 |\n| 7.6.1          | 7.6.1.0        | Mar 30, 2020 |\n| 7.6.0          | 7.6.0.0        | Feb 12, 2020 |\n| 7.5.2          | 7.5.2.0        | Jan 25, 2020 |\n| 7.5.1          | 7.5.1.0        | Jan 21, 2020 |\n| 7.5.0          | 7.5.0.0        | Jan 16, 2020 |\n| 7.4.2          | 7.4.2.0        | Jan 13, 2020 |\n| 7.4.1          | 7.4.1.0        | Jan 13, 2020 |\n| 7.4.0          | 7.4.0.0        | Jan 07, 2020 |\n| 7.3.2          | 7.3.2.0        | Oct 05, 2019 |\n| 7.3.1          | 7.3.1.0        | Sep 18, 2019 |\n| 7.3.0          | 7.3.0.0        | Sep 17, 2019 |\n| 7.2.1          | 7.2.1.0        | Jul 31, 2019 |\n| 7.2.0          | 7.2.0.0        | Jul 12, 2019 |\n| 7.1.1          | 7.1.1.0        | May 31, 2019 |\n| 7.1.0          | 7.1.0.0        | May 23, 2019 |\n| 7.0.1          | 7.0.1.0        | May 08, 2019 |\n| 7.0.0          | 7.0.0.0        | Apr 11, 2019 |\n\n## Install\n\n`./bin/elasticsearch-plugin install -b https://github.com/vvanholl/elasticsearch-prometheus-exporter/releases/download/7.17.7.0/prometheus-exporter-7.17.7.0.zip`\n\n**Do not forget to restart the node after the installation!**\n\nNote that the plugin needs the following special permissions:\n\n- java.lang.RuntimePermission accessClassInPackage.sun.misc\n- java.lang.RuntimePermission accessDeclaredMembers\n- java.lang.reflect.ReflectPermission suppressAccessChecks\n\nIf you have a lot of indices and think this data is irrelevant, you can disable in the main configuration file:\n\n```\nprometheus.indices: false\n```\n\nTo disable exporting cluster settings use:\n```\nprometheus.cluster.settings: false\n```\n\nThese settings can be also [updated dynamically](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html).\n\n## Uninstall\n\n`./bin/elasticsearch-plugin remove prometheus-exporter`\n\nDo not forget to restart the node after installation!\n\n## Usage\n\nMetrics are directly available at:\n\n    http://\u003cyour-elasticsearch-host\u003e:9200/_prometheus/metrics\n\nAs a sample result, you get:\n\n```\n# HELP es_process_mem_total_virtual_bytes Memory used by ES process\n# TYPE es_process_mem_total_virtual_bytes gauge\nes_process_mem_total_virtual_bytes{cluster=\"develop\",node=\"develop01\",} 3.626733568E9\n# HELP es_indices_indexing_is_throttled_bool Is indexing throttling ?\n# TYPE es_indices_indexing_is_throttled_bool gauge\nes_indices_indexing_is_throttled_bool{cluster=\"develop\",node=\"develop01\",} 0.0\n# HELP es_jvm_gc_collection_time_seconds Time spent for GC collections\n# TYPE es_jvm_gc_collection_time_seconds counter\nes_jvm_gc_collection_time_seconds{cluster=\"develop\",node=\"develop01\",gc=\"old\",} 0.0\nes_jvm_gc_collection_time_seconds{cluster=\"develop\",node=\"develop01\",gc=\"young\",} 0.0\n# HELP es_indices_requestcache_memory_size_bytes Memory used for request cache\n# TYPE es_indices_requestcache_memory_size_bytes gauge\nes_indices_requestcache_memory_size_bytes{cluster=\"develop\",node=\"develop01\",} 0.0\n# HELP es_indices_search_open_contexts_number Number of search open contexts\n# TYPE es_indices_search_open_contexts_number gauge\nes_indices_search_open_contexts_number{cluster=\"develop\",node=\"develop01\",} 0.0\n# HELP es_jvm_mem_nonheap_used_bytes Memory used apart from heap\n# TYPE es_jvm_mem_nonheap_used_bytes gauge\nes_jvm_mem_nonheap_used_bytes{cluster=\"develop\",node=\"develop01\",} 5.5302736E7\n\n...\n```\n\n### Configure the Prometheus target\n\nOn your Prometheus servers, configure a new job as usual.\n\nFor example, if you have a cluster of 3 nodes:\n\n```YAML\n- job_name: elasticsearch\n  scrape_interval: 10s\n  metrics_path: \"/_prometheus/metrics\"\n  static_configs:\n  - targets:\n    - node1:9200\n    - node2:9200\n    - node3:9200\n```\n\nOf course, you could use the service discovery service instead of a static config.\n\nJust keep in mind that `metrics_path` must be `/_prometheus/metrics`, otherwise Prometheus will find no metric.\n\n## Project sources\n\nThe Maven project site is available at [GitHub](https://github.com/vvanholl/elasticsearch-prometheus-exporter).\n\n## Testing\n\nProject contains [integration tests](src/test/resources/rest-api-spec) implemented using\n[rest layer](https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc#testing-the-rest-layer)\nframework.\n\nTo run everything similar to the GitHub Actions pipeline you can do:\n```\ndocker run -v $(pwd):/home/gradle gradle:7.0.2-jdk16 su gradle -c 'gradle check'\n```\nNOTE: Please keep version in sync with .github/workflows/ci.yml\n\n\nComplete test suite is run using:\n```\ngradle clean check\n```\n\nTo run individual test file use:\n```\ngradle :integTest \\\n  -Dtests.class=org.elasticsearch.rest.PrometheusRestHandlerClientYamlTestSuiteIT \\\n  -Dtests.method=\"test {yaml=resthandler/20_metrics/Prometheus metrics can be pulled}\"\n```\n\n## Credits\n\nThis plugin mainly uses the [Prometheus JVM Client](https://github.com/prometheus/client_java).\n\n## License\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvanholl%2Felasticsearch-prometheus-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvvanholl%2Felasticsearch-prometheus-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvvanholl%2Felasticsearch-prometheus-exporter/lists"}