{"id":29461829,"url":"https://github.com/opensearch-project/opensearch-prometheus-exporter","last_synced_at":"2025-09-22T15:33:23.103Z","repository":{"id":37101681,"uuid":"441206783","full_name":"opensearch-project/opensearch-prometheus-exporter","owner":"opensearch-project","description":"Prometheus exporter plugin for OpenSearch \u0026 OpenSearch Mixin","archived":false,"fork":false,"pushed_at":"2025-09-08T06:05:24.000Z","size":758,"stargazers_count":170,"open_issues_count":65,"forks_count":77,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-09-12T21:38:50.412Z","etag":null,"topics":["metrics","mixin","opensearch","opensearch-mixin","opensearch-plugins","prometheus","prometheus-exporter"],"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/opensearch-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-12-23T14:34:14.000Z","updated_at":"2025-09-08T12:41:53.000Z","dependencies_parsed_at":"2023-09-27T18:48:03.843Z","dependency_job_id":"3e4de54f-9ff0-4266-ae2e-118a6fb242b4","html_url":"https://github.com/opensearch-project/opensearch-prometheus-exporter","commit_stats":null,"previous_names":["aiven-open/prometheus-exporter-plugin-for-opensearch","opensearch-project/opensearch-prometheus-exporter"],"tags_count":53,"template":false,"template_full_name":"opensearch-project/opensearch-plugin-template-java","purl":"pkg:github/opensearch-project/opensearch-prometheus-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensearch-project%2Fopensearch-prometheus-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensearch-project%2Fopensearch-prometheus-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensearch-project%2Fopensearch-prometheus-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensearch-project%2Fopensearch-prometheus-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensearch-project","download_url":"https://codeload.github.com/opensearch-project/opensearch-prometheus-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensearch-project%2Fopensearch-prometheus-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276430824,"owners_count":25641122,"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","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["metrics","mixin","opensearch","opensearch-mixin","opensearch-plugins","prometheus","prometheus-exporter"],"created_at":"2025-07-14T03:02:58.871Z","updated_at":"2025-09-22T15:33:23.097Z","avatar_url":"https://github.com/opensearch-project.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Prometheus Exporter Plugin for OpenSearch\n\nThe [Prometheus® exporter](https://prometheus.io/docs/instrumenting/writing_exporters/) plugin for OpenSearch® exposes many OpenSearch metrics in [Prometheus format](https://prometheus.io/docs/instrumenting/exposition_formats/).\n\n- [Preface](#preface)\n- [Introduction](#introduction)\n- [Compatibility Matrix](#compatibility-matrix)\n- [Install or Remove Plugin](#install-or-remove-plugin)\n- [Plugin Configuration](#plugin-configuration)\n  - [Static settings](#static-settings) \n  - [Dynamic settings](#dynamic-settings) \n- [Usage](#usage)\n- [Build from Source](#build-from-source)\n- [Testing](#testing)\n  - [BWC Testing](#bwc-testing)\n- [License](#license)\n- [Trademarks \u0026 Attributions](#trademarks--attributions)\n\n---\n\n## Preface\n\nThis repository contains two projects that are related, but each can be used independently:\n\n1. The first project is a Java plugin – Prometheus Exporter Plugin for OpenSearch® – this code lives in the `main` branch.\n2. The second project is a Jsonnet bundle – OpenSearch® Mixin – this code lives in the `mixin` branch.\n\n## Introduction\n\nThis plugin was started as a fork of [Prometheus exporter for Elasticsearch®](https://github.com/vvanholl/elasticsearch-prometheus-exporter) (it was forked in version 7.10.2.0; commit hash: [8dc7f85](https://github.com/vvanholl/elasticsearch-prometheus-exporter/commit/8dc7f85109fe1601a68010e9de598a9b131afd02)) utilizing [OpenSearch plugin template](https://github.com/opensearch-project/opensearch-plugin-template-java). It uses the official [Prometheus Java Simpleclient](https://github.com/prometheus/client_java/tree/simpleclient).\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 (notably [disk watermarks](https://docs.opensearch.org/docs/latest/install-and-configure/configuring-opensearch/cluster-settings/#cluster-level-routing-and-allocation-settings) that can be updated dynamically)\n\n## Compatibility Matrix\n\nFor the complete compatibility matrix including all supported OpenSearch versions and corresponding plugin versions, see [COMPATIBILITY.md](COMPATIBILITY.md).\n\n## Install or Remove Plugin\n\nYou need to install the plugin on every OpenSearch node that will be scraped by Prometheus.\n\nTo **install** the plugin:\n\n`./bin/opensearch-plugin install https://github.com/opensearch-project/opensearch-prometheus-exporter/releases/download/3.2.0.0/prometheus-exporter-3.2.0.0.zip`\n\nTo **remove** the plugin.\n\n`./bin/opensearch-plugin remove prometheus-exporter`\n\nFor more info about plugin CLI, visit: \u003chttps://docs.opensearch.org/docs/latest/install-and-configure/plugins/\u003e\n\n## Plugin Configuration\n\n### Static settings\n\nStatic settings are configured in `config/opensearch.yml`.\n\n#### Metric name prefix\n\nAll metric names share common prefix, by default set to `opensearch_`.\n\nThe value of this prefix can be customized using setting:\n```\nprometheus.metric_name.prefix: \"opensearch_\"\n```\n\n### Dynamic settings\n\nDynamic settings are configured in `config/opensearch.yml` but they can also be [updated](https://docs.opensearch.org/docs/latest/api-reference/cluster-api/cluster-settings/#update-cluster-setting) at any time via REST API.\n\n#### Index level metrics\n\nWhether to export detailed index level metrics or not. Default value: `true`.\n\nDetailed index level metrics can represent a lot of data and can lead to high-cardinality labels in Prometheus.\nIf you do not need detailed index level metrics **it is recommended to disable it** via setting:\n\n```\nprometheus.indices: false\n```\n\n#### Cluster settings\n\nWhether to export cluster settings metrics or not. Default value: `true`.\n\nTo disable exporting cluster settings use:\n```\nprometheus.cluster.settings: false\n```\n\n#### Nodes filter\n\nMetrics include statistics about individual OpenSearch nodes.\nBy default, only statistics from the node that received the request are included.\n\nPrometheus exporter can be configured to include statistics from other nodes as well.\nThis filter is directly utilizing OpenSearch [Node filters](https://docs.opensearch.org/docs/latest/api-reference/nodes-apis/index/#node-filters) feature.\nDefault value: `\"_local\"`.\n\nFor example to get stats for all cluster nodes from any node use settings:\n```\nprometheus.nodes.filter: \"_all\"\n```\n\n#### Indices filter\n\nPrometheus exporter can be configured to filter indices statistics from selected indices.\nTo target all indices, use \"\" or * or _all or null.\nDefault value: `\"\"`.\n\nFor example to filter indices statistics:\n```\nprometheus.indices_filter.selected_indices: \"log-*,*log,*log*,log*-test\"\n```\n\nUsers can select which option for filtering indices statistics.\nDefault value: `\"STRICT_EXPAND_OPEN_FORBID_CLOSED\"`.\n\nFor example to select an option:\n```\nprometheus.indices_filter.selected_option: \"LENIENT_EXPAND_OPEN\"\n```\nHere is a list of indices options available for selection\n```\nSTRICT_EXPAND_OPEN: indices options that requires every specified index to exist, expands wildcards only to open indices and allows that no indices are resolved from wildcard expressions (not returning an error).\nSTRICT_EXPAND_OPEN_HIDDEN: indices options that requires every specified index to exist, expands wildcards only to open indices, includes hidden indices, and allows that no indices are resolved from wildcard expressions (not returning an error).\nSTRICT_EXPAND_OPEN_FORBID_CLOSED: indices options that requires every specified index to exist, expands wildcards only to open indices, allows that no indices are resolved from wildcard expressions (not returning an error) and forbids the use of closed indices by throwing an error.\nSTRICT_EXPAND_OPEN_HIDDEN_FORBID_CLOSED: indices options that requires every specified index to exist, expands wildcards only to open indices, includes hidden indices, and allows that no indices are resolved from wildcard expressions (not returning an error) and forbids the use of closed indices by throwing an error.\nSTRICT_EXPAND_OPEN_FORBID_CLOSED_IGNORE_THROTTLED: indices options that requires every specified index to exist, expands wildcards only to open indices, allows that no indices are resolved from wildcard expressions (not returning an error), forbids the use of closed indices by throwing an error and ignores indices that are throttled.\nSTRICT_EXPAND_OPEN_CLOSED: indices option that requires every specified index to exist, expands wildcards to both open and closed indices and allows that no indices are resolved from wildcard expressions (not returning an error).\nSTRICT_EXPAND_OPEN_CLOSED_HIDDEN: indices option that requires every specified index to exist, expands wildcards to both open and closed indices, includes hidden indices, and allows that no indices are resolved from wildcard expressions (not returning an error).\nSTRICT_SINGLE_INDEX_NO_EXPAND_FORBID_CLOSED: indices option that requires each specified index or alias to exist, doesn't expand wildcards and throws error if any of the aliases resolves to multiple indices.\nLENIENT_EXPAND_OPEN: indices options that ignores unavailable indices, expands wildcards only to open indices and allows that no indices are resolved from wildcard expressions (not returning an error).\nLENIENT_EXPAND_OPEN_HIDDEN: indices options that ignores unavailable indices, expands wildcards to open and hidden indices, and allows that no indices are resolved from wildcard expressions (not returning an error).\nLENIENT_EXPAND_OPEN_CLOSED: indices options that ignores unavailable indices, expands wildcards to both open and closed indices and allows that no indices are resolved from wildcard expressions (not returning an error).\nLENIENT_EXPAND_OPEN_CLOSED_HIDDEN: indices options that ignores unavailable indices, expands wildcards to all open and closed indices and allows that no indices are resolved from wildcard expressions (not returning an error).\n```\n\n## Usage\n\nMetrics are directly available at:\n\n    http(s)://\u003copensearch-host\u003e:9200/_prometheus/metrics\n\nAs a sample result, you get:\n\n```\n# HELP opensearch_process_mem_total_virtual_bytes Memory used by ES process\n# TYPE opensearch_process_mem_total_virtual_bytes gauge\nopensearch_process_mem_total_virtual_bytes{cluster=\"develop\",node=\"develop01\",} 3.626733568E9\n# HELP opensearch_indices_indexing_is_throttled_bool Is indexing throttling ?\n# TYPE opensearch_indices_indexing_is_throttled_bool gauge\nopensearch_indices_indexing_is_throttled_bool{cluster=\"develop\",node=\"develop01\",} 0.0\n# HELP opensearch_jvm_gc_collection_time_seconds Time spent for GC collections\n# TYPE opensearch_jvm_gc_collection_time_seconds counter\nopensearch_jvm_gc_collection_time_seconds{cluster=\"develop\",node=\"develop01\",gc=\"old\",} 0.0\nopensearch_jvm_gc_collection_time_seconds{cluster=\"develop\",node=\"develop01\",gc=\"young\",} 0.0\n# HELP opensearch_indices_requestcache_memory_size_bytes Memory used for request cache\n# TYPE opensearch_indices_requestcache_memory_size_bytes gauge\nopensearch_indices_requestcache_memory_size_bytes{cluster=\"develop\",node=\"develop01\",} 0.0\n# HELP opensearch_indices_search_open_contexts_number Number of search open contexts\n# TYPE opensearch_indices_search_open_contexts_number gauge\nopensearch_indices_search_open_contexts_number{cluster=\"develop\",node=\"develop01\",} 0.0\n# HELP opensearch_jvm_mem_nonheap_used_bytes Memory used apart from heap\n# TYPE opensearch_jvm_mem_nonheap_used_bytes gauge\nopensearch_jvm_mem_nonheap_used_bytes{cluster=\"develop\",node=\"develop01\",} 5.5302736E7\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: opensearch\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## Build from Source\n\nTo build the plugin you need JDK 17:\n\n```\n./gradlew clean build\n```\nIf you have doubts about the system requirements, please check the [CI.yml](.github/workflows/CI.yml) file for more information.\n\n## Testing\n\nProject contains:\n- [integration tests](src/yamlRestTest/resources/rest-api-spec) implemented using\n[rest layer](https://github.com/opensearch-project/OpenSearch/blob/main/TESTING.md#testing-the-rest-layer)\nframework\n- [internal cluster tests](src/test)\n\nComplete test suite is run using:\n```\n./gradlew clean check\n```\n\nTo run individual integration rest test file use:\n```\n./gradlew :yamlRestTest \\\n  -Dtests.method=\"test {yaml=/20_11_index_level_metrics_disabled/Dynamically disable index level metrics}\"\n```\n\n### BWC Testing\n\nBackward Compatibility (BWC) Testing is run manually using provided shell script:\n\n```\n./bwctest.sh\n```\n\nIt is not part of `./gradlew [build|check]` task(s), but it is included in the CI workflow.\n\nOpenSearch versions used during BWC tests use determined by properties located in `gradle.properties` file. Specifically `project.version` and `project.BWCversion`. Version of plugin deployed into `project.BWCversion` cluster is specified by `project.BWCPluginVersion` property.\n\nIn the beginning of BWC tests the actual version of plugin (`project.version`) is build using `bundlePlugin` gradle task and the `project.BWCPluginVersion` plugin is downloaded from GitHub releases. Both ZIP files are placed into `src/test/resource/org/opensearch/prometheus-exrpoter/bwc/prometheus-exporter` folder (this folder is ignored by git). \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\n## Trademarks \u0026 Attributions\n\nPrometheus is a registered trademark of The Linux Foundation. OpenSearch is a registered trademark of Amazon Web Services. Elasticsearch is a registered trademark of Elasticsearch BV.\n\nWe gratefully thank all the contributors from the [Aiven organization](https://github.com/Aiven-Open) for their work on this project prior to its migration to the OpenSearch organization.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensearch-project%2Fopensearch-prometheus-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensearch-project%2Fopensearch-prometheus-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensearch-project%2Fopensearch-prometheus-exporter/lists"}