We set up an alarm for the "AWS/RDS" Namespace, will this alarm monitor all RDS instances?

0

Hi re:Post,

We set up an alarm for the "AWS/RDS" Namespace, will this alarm monitor all of our RDS instances?

----> Namespace: AWS/RDS

----> Metric name: FreeStorageSpace

We have (31) RDS instances, will this alarm monitor all of them? The alarm source in JSON format is:

{
    "Type": "AWS::CloudWatch::Alarm",
    "Properties": {
        "AlarmName": "FreeSpace90GBAlarm",
        "AlarmDescription": "FreeSpace90GB Alarm test to dc email",
        "ActionsEnabled": true,
        "OKActions": [],
        "AlarmActions": [
            "arn:aws:sns:us-east-2:910286192445:FreeSpace90GB"
        ],
        "InsufficientDataActions": [],
        "MetricName": "FreeStorageSpace",
        "Namespace": "AWS/RDS",
        "Statistic": "Minimum",
        "Dimensions": [],
        "Period": 60,
        "EvaluationPeriods": 1,
        "DatapointsToAlarm": 1,
        "Threshold": 96636764160,
        "ComparisonOperator": "LessThanOrEqualToThreshold",
        "TreatMissingData": "breaching"
    }
}

Thank you for your time and help!

Best Regards, Donald

3 Answers
1

Hi Donald, the alarm you have defined will not work, because the alarm does not match missing dimensions. Do you need to perform outlier detection, to be alerted if at least one instance is breaching? If so, you may want to give Metrics Insights queries a try, you can alarm on the MIN aggregate of a query on the namespace. If you define your alarm using infrastructure as code, you use an expression instead of a metric and write the SQL query in it. To get started, you can try it from the console, after selecting All Metrics from the navigation menu, click on the Multi source query tab, the query builder can assist you in crafting your first query if you want to familiarize yourself with the syntax.

profile pictureAWS
Jsc
answered 3 months ago
  • Hi Jsc, Thank you for your quick reply and help! When I created the alarm I did not come across wording around adding/matching dimensions in it's setup. How does one match an alarm to dimensions? I'm trying to get an alert whenever the free space goes below or equal to 90 GB. How can I accomplish this? Thank you for your time and help. Best Regards, Donald

1

Hi DC, thanks for your patience. When you create an alarm, you have an option between referencing a metric directly, or inputting an expression. When you reference a metric directly, you can only reference a single metric at a time, and must specify its namespace, metric name and list of dimensions. You can check the list of dimensions from your "All metrics" page. The definition you share above would work only if there already existed a pre-aggregated metric across all your instances. If that's not the case, you need to perform the aggregation yourself, which you can do by using an expression instead. To define a metric from an SQL expression, you don't specify the properties metricname, namespace, statistic, dimension and period, and you add a Metrics structure instead (please note I have not been able to check what is the correct schema name, you need to replace the name-of-the-metrics-schema string below with the correct name):

{
    "Type": "AWS::CloudWatch::Alarm",
    "Properties": {
        "AlarmName": "FreeSpace90GBAlarm",
        "AlarmDescription": "FreeSpace90GB Alarm test to dc email",
        "ActionsEnabled": true,
        "OKActions": [],
        "AlarmActions": [
            "arn:aws:sns:us-east-2:910286192445:FreeSpace90GB"
        ],
        "InsufficientDataActions": [],
        "Dimensions": [],
        "EvaluationPeriods": 1,
        "DatapointsToAlarm": 1,
        "Threshold": 96636764160,
        "ComparisonOperator": "LessThanOrEqualToThreshold",
        "TreatMissingData": "breaching",
        "Metrics": [
            {
                "Id": "q1",
                "ReturnData": true,
                "Expression": "SELECT MIN(FreeStorageSpace) FROM SCHEMA(\"AWS/RDS\", name-of-the-metrics-schema)",
                "Period": 300
            }
        ]
    }
}

If you're not sure how to identify the schema name, you can create the SQL using the query builder in the "All metrics" page, it will help you auto-complete the expression.

profile pictureAWS
Jsc
answered 2 months ago
  • Hi Jsc, Thank you for this detailed explanation and sample code! I will be reviewing it in detail today / tomo ! Best Regards, Donald

0

Hi ! Sorry for late reply! Regarding this section and the "name-of-the-metrics-schema" part:

"Metrics": [ { "Id": "q1", "ReturnData": true, "Expression": "SELECT MIN(FreeStorageSpace) FROM SCHEMA(\"AWS/RDS\", name-of-the-metrics-schema)", "Period": 300 } ]

The query builder, I did not see any way for it offer me suggestions as to what the name of the metrics schema is. How do we find the name of the metrics schema?

Thank you for your time and help. Best Regards, Donald

profile picture
DC
answered 2 months ago
  • The query builder on the "Multi source query" tab will guide you when you click in the namespace input field by popping up a list of values that you can choose from, which will auto discover the namespace and schema for you. You can keep on building your query using the builder and run it to validate that the output matches the visualization you expect. When you are satisfied with the visualization, click on the editor button in the top right corner of the query builder to switch the editor to display the source query in SQL, you can copy it and paste it in the expression field of your alarm definition.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions