We have an AWS Elasticsearch cluster setup. However, our Error rate alarm goes off at regular intervals. The way we are trying to calculate our error rate is:
((sum(4xx) + sum(5xx))/sum(ElasticsearchRequests)) * 100
However, if you look at the screenshot below, at 7:15 4xx was 4, however ElasticsearchRequests value is only 2. Based on the metrics info on AWS Elasticsearch documentation page, ElasticsearchRequests should be total number of requests, so it should clearly be greater than or equal to 4xx.
Can someone please help me understand in what I am doing wrong here?



AWS definitions of these metrics are:
Please note the different terms used for the subjects of the metrics: cluster vs domain
To my understanding,
OpenSearchRequestsonly considers requests that actually reach the underlying OpenSearch/ElasticSearch cluster, so some the4xxrequests might not (e.g. 403 errors), hence the difference in metrics.Also, AWS only recommends comparing
5xxtoOpenSearchRequests: