How to Monitor OpenSearch in K8s
This article was last updated on: May 17, 2026 am
Overview
OpenSearch is seeing increasing adoption, but its ecosystem is not yet fully mature.
For the following scenario:
- Monitoring containerized OpenSearch or OpenSearch running in K8s
I checked and found that the official project does not yet provide a comprehensive solution.
This article explains how to monitor OpenSearch in K8s, covering the full pipeline from installing the exporter plugin to metrics collection and visualization.
Introduction to OpenSearch
- OpenSearch is an open-source distributed search engine (forked from a specific version of Elasticsearch) that supports use cases such as fast, scalable full-text search, application and infrastructure monitoring, security and event information management, and operational health tracking.
- OpenSearch offers a variety of features and plugins to help you index, secure, monitor, and analyze your data.
- OpenSearch includes a demo configuration so you can get up and running quickly, but before using OpenSearch in production, you must manually configure the security plugin with your own certificates, authentication methods, users, and passwords.
- OpenSearch is backed by AWS, and all components are available on GitHub under the Apache License Version 2.0.
Introduction to Prometheus Exporter Plugin for OpenSearch
- The Prometheus Exporter plugin exposes OpenSearch metrics in Prometheus format.
- The plugin version must exactly match the OpenSearch version, so you need to keep the prometheus-exporter-plugin-for-opensearch version in sync with the OpenSearch version.
- The plugin can be installed on each OpenSearch node that you want Prometheus to scrape.
- The plugin can be configured via static and dynamic settings in config/opensearch.yml.
- Metrics are available directly at http(s)://
:9200/_prometheus/metrics.
📚️ References
This article uses 2 resources:
Implementation
Two approaches:
- Build a custom image that includes the prometheus-exporter plugin
- Install the prometheus-exporter plugin via the OpenSearch Helm Chart
(Approach 1) Build and Use a Custom Image with the prometheus-exporter Plugin
│ 📝Notes:
│
│ This example uses opensearch:2.12 as the version
Dockerfile contents:
1 | |
│ 📝Notes
│
│ If the download times out during docker build, you can replace the EXPORTER_PLUGIN_URL line with a proxy URL (not detailed here).
│ Alternatively, download the file first, then COPY it into the image and run:
│ opensearch-plugin install -b file:///path/to/prometheus-exporter-2.12.0.0.zip
Build and push the image:
1 | |
│ 📝Notes
│
│ You can use a CI/CD pipeline to automatically build new images as OpenSearch and prometheus-exporter-plugin-for-opensearch are updated.
│ I believe that as the OpenSearch ecosystem matures, there will be OpenSearch images that already include the exporter.
For containerized or K8s-based OpenSearch, simply replace the image with the custom-built one that includes the prometheus-exporter.
For example:
Originally:
1 | |
Change to:
1 | |
(Approach 2) Use the OpenSearch Helm Chart
If you are running OpenSearch in K8s, you can also use the OpenSearch Helm Chart, which includes the ability to install third-party plugins. The relevant values.yaml is as follows:
1 | |
│ 📚️Reference:
│
│ OpenSearch Helm Chart
Modify the prometheus-exporter Configuration
Additionally, you can modify the prometheus-exporter configuration as needed. For detailed configuration instructions, see:
Example configuration:
Append the following to config/opensearch.yml:
1 | |
│ 📝Disclaimer
│
│ plugins.security.disabled: true is optional and allows accessing the plugin URL over HTTP. Not recommended for production. Use only for quick verification.
│
│ prometheus.indices_filter.selected_indices is provided as a reference only. Adjust as needed.
│
│ prometheus.indices_filter.selected_option uses the default configuration. Please read the details and adjust as needed.
After modifying the configuration, restart the container for the changes to take effect.
Verify the Plugin Is Enabled
Metrics are available directly at:
1 | |
As an example, you will get output like the following:
1 | |
Collect Metrics with Prometheus
(This is a reference example only; adjust as needed.) Append the following under the scrape section in your Prometheus configuration:
1 | |
Configure Prometheus Rules and Alerts
Here is a simple example. If you are already using OpenSearch, you likely have existing ES-related rules and alerts that can be adapted with minor modifications.
1 | |
View in Grafana
You can use the following Grafana Dashboard:
The result looks like this:

More OpenSearch dashboards can be found by searching for the keyword “OpenSearch” at https://grafana.com/grafana/dashboards/.
Summary
How to monitor containerized or K8s-based OpenSearch?
- First, install the OpenSearch Prometheus Exporter plugin using one of 2 methods:
- Build a custom image that includes the OpenSearch Prometheus Exporter plugin
- Install via the OpenSearch Helm Chart
- Configure Prometheus scrape config
- Configure Prometheus Rules and Alerts
- View in Grafana
That’s it.