An Idle OpenSearch Domain Never Reads Zero Searches: What We Check Instead
We tested our idle OpenSearch check on a domain nobody used. Searches read about 90 a day, not zero. What the metrics showed, and the rule that finally worked.

After this post you will know why "zero searches" is the wrong test for an idle Amazon OpenSearch Service domain, which CloudWatch metrics to read instead, and how to check your own domains with the AWS CLI.
We found this out the slow way. Our idle_opensearch check had four defects before it worked: it flagged every domain over the cost threshold, it ignored indexing (so a domain that only ingests data could be called idle), it did not skip domains AWS was already deleting, and then it never fired at all. The last one is the interesting one.
Why an idle OpenSearch domain still costs money
An OpenSearch Service domain bills for its instances by the hour. Requests do not change the rent. A domain that nobody queries costs the same as a busy one, plus storage.
So "find the idle domain" is a good check to have. Our first version was the obvious one: read the SearchRate metric from the AWS/ES namespace, and call the domain idle when it is zero for the whole window.
The window is 7 days by default.
Once the earlier defects were fixed, that rule never fired.
What an unused domain actually reports
To test the check, we created a small OpenSearch domain in a test account and did nothing with it. No application, no index, no queries. We waited a week and read the metrics.
SearchRatesummed to about 90 a day, every day. The largest single datapoint was 23.SearchableDocumentsread 2, every day. System indices count.- Another request series sat near 14,000 successful responses a day.
OpenSearchRequests, which counts requests made to the cluster, was not zero either.
A domain with no users looked busy by every number a "zero" rule would look at. We do not know exactly what makes the searches. Our best guess is plugin activity inside the cluster, and we have not confirmed it, so treat that as a guess. The request counter had a different cause, covered below.
The lesson is small and annoying: request and search counters include traffic nobody on your team sent. A rule that needs one of them to be zero will never match a real domain.
The signal that did separate idle from busy
The request counter was the useful one, once we split it.
CloudWatch publishes InvalidHostHeaderRequests: requests with an invalid or missing host header. On our unused domain, every request in OpenSearchRequests was one of those: traffic from the open internet hitting a public endpoint, not from any client of ours. Subtract the invalid-host-header requests from OpenSearchRequests for each day, and the difference was exactly zero on every day of the window.
So the rule that finally worked is built on client requests, not on searches:
- For each day in the window, client requests are
OpenSearchRequestsminusInvalidHostHeaderRequests. - Every day must be covered by a datapoint. A day with a missing or negative value makes the answer "unknown", never "zero".
- Indexing must read zero on every day too, so an ingest-only domain is not called idle.
- A red cluster, a cross-cluster connection, or stored data above a small threshold vetoes the finding.
The request subtraction is _opensearch_client_requests in data_providers/online.py, which is public. The idle verdict that uses it runs in CloudWise's hosted scanner on the Shield plan and above, not in the free CLI and not on the free hosted plan.
What this rule cannot see
We kept the caveats in the code and they belong here too.
- On a domain inside a VPC, or one with a restrictive access policy, a client that reaches the domain by IP address can still be served and still be counted as an invalid host header. The subtraction can hide that traffic. That is why the other vetoes exist, and why the finding is marked medium confidence, not high.
- Closed indices and domains used only as a cross-cluster search gateway have no metric that exposes them.
- Idle is evidence, not a verdict. A domain that only wakes for a quarterly report looks the same.
For now idle_opensearch is plan-only. It tells you where to look. It does not offer a one-click delete.
Did it work?
On 2026-11-28 the check ran against a fixture domain created for the test, with a control domain beside it. It flagged the idle one at $26.28 a month at list price (one t3.small.search instance, 7 days with no client requests and no indexing). It stayed silent on the control. Both domains were deleted the same day.
That is one domain on one instance type, in one account we built for the purpose. It shows the rule fires on a truly idle domain and stays quiet on a control. It does not tell you how many of your domains are idle.
Check your own domains
You can read the same numbers yourself with the AWS CLI. This sums all requests to one domain, day by day, over seven days. Swap in your own domain name and account ID:
aws cloudwatch get-metric-statistics \
--namespace AWS/ES --metric-name OpenSearchRequests \
--dimensions Name=DomainName,Value=my-domain Name=ClientId,Value=123456789012 \
--start-time "$(date -u -v-7d +%FT%TZ)" --end-time "$(date -u +%FT%TZ)" \
--period 86400 --statistics Sum
Run it again with InvalidHostHeaderRequests, subtract day by day, and read IndexingRate the same way. (date -v-7d is the macOS form; on Linux use date -u -d '7 days ago' +%FT%TZ.)
The hosted scanner runs this check for you on the Shield plan and above. The free CLI is a different, smaller set of checks, and it does not include this one. It runs on your machine with your own read-only AWS credentials. Nothing is sent to CloudWise unless you choose to share a summary when it asks, and the default is no. The CLI is open source under the Apache License 2.0 (the CLI only, not the hosted product).
pipx install cloudcostwise
cloudcostwise scan --profile my-profile --regions us-east-1
AWS bills the scan's Cost Explorer calls; add --no-cost-explorer to skip them. To see the output first, uvx cloudcostwise scan --demo prints a recorded sample scan with no AWS login.
Free, read-only, a few minutes: cloudcostwise.io
Find this waste in your own account
Run the free scanner on your own machine. Read-only, no signup, and nothing is sent to CloudWise unless you choose to share a summary at the end.
$ pipx install cloudcostwise
What it checksPrefer a dashboard? Start a free hosted scan →