'Setting up a AWS cloudwatch alert when ElasticsearchRequests are too high

I am trying to setup a cloudwatch alert that if more than lets say 5000 http requests are sent to an AWS ES cluster using CloudFormation, I see there is the ElasticsearchRequests metric i can use and this is what i have so far:

  ClusterElasticsearchRequestsTooHighAlarm:
    Condition: HasAlertTopic
    Type: 'AWS::CloudWatch::Alarm'
    Properties:
      AlarmActions:
      - {'Fn::ImportValue': !Sub '${ParentAlertStack}-TopicARN'}
      AlarmDescription: 'ElasticsearchRequests are too high.'
      ComparisonOperator: GreaterThanThreshold
      Dimensions:
      - Name: ClientId
        Value: !Ref 'AWS::AccountId'
      - Name: DomainName
        Value: !Ref ElasticsearchDomain
      EvaluationPeriods: 1
      MetricName: 'ElasticsearchRequests'
      Namespace: 'AWS/ES'
      OKActions:
      - {'Fn::ImportValue': !Sub '${ParentAlertStack}-TopicARN'}
      Period: 60
      Statistic: Maximum
      Threshold: 5000

Does this look correct?

Should I use SampleCount instead of Maximum for the Statistic?

Any advice is much appreciated



Solution 1:[1]

According to the AWS Doc about monitoring ELasticSearch/OpenSearch clusters, the relevant statistic for the metric ElasticsearchRequests is Sum.

Here is what the docs say:

OpenSearchRequests

The number of requests made to the Elasticsearch/OpenSearch cluster.

Relevant statistics: Sum

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Shivam Anand