Unit value in RDS CloudWatch Alarm is Null

0

Hello,

I have been trying to obtain a value from an SNS message passed from a CloudWatch Alarm for the DatabaseConnections Metric. The value of the Unit is null hence I cannot parse the message to obtain the DBIdentifier value. Is there a reason why the CloudWatch alarm does not have a value for the Unit? Looking at the AWS RDS documentation, the value for DatabaseConnections Metric, Unit should be Count but the alarm gives null. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-metrics.html#rds-cw-metrics-instance

Below is the message obtained from the SNS message body:


{
    "AlarmName": "awsrds-poc-test-High-DB-Connections",
    "AlarmDescription": "When the DB-Connections is lower than 1",
    "AWSAccountId": "<##########>",
    "AlarmConfigurationUpdatedTimestamp": "2022-06-17T08:54:32.735+0000",
    "NewStateValue": "ALARM",
    "NewStateReason": "Threshold Crossed: 1 out of the last 1 datapoints [0.0 (17/06/22 08:50:00)] was less than the threshold (1.0) (minimum 1 datapoint for OK -> ALARM transition).",
    "StateChangeTime": "2022-06-17T08:55:15.402+0000",
    "Region": "US East (N. Virginia)",
    "AlarmArn": "arn:aws:cloudwatch:us-east-1:678932343753:alarm:awsrds-poc-test-High-DB-Connections",
    "OldStateValue": "OK",
    "OKActions": [],
    "AlarmActions": [
        "arn:aws:sns:us-east-1:678932343753:sns-alarm"
    ],
    "InsufficientDataActions": [],
    "Trigger": {
        "MetricName": "DatabaseConnections",
        "Namespace": "AWS/RDS",
        "StatisticType": "Statistic",
        "Statistic": "AVERAGE",
        "Unit": null,
        "Dimensions": [
            {
                "value": "<######>",
                "name": "DBInstanceIdentifier"
            }
        ],
        "Period": 300,
        "EvaluationPeriods": 1,
        "DatapointsToAlarm": 1,
        "ComparisonOperator": "LessThanThreshold",
        "Threshold": 1,
        "TreatMissingData": "",
        "EvaluateLowSampleCountPercentile": ""
    }
}
1 個回答
0

Hi, it looks like the alarm is a custom alarm. If that is the case, you can specify the unit of the metric when creating the alarm, although it is not recommended to specify the unit if it is not needed, as if the unit is misspelled, the alarm will not be able to identify the metric requested. Can you please clarify why the unite being null prevents you from parsing the message to obtain the DBIdentifier value, as null is a valid value from a json standpoint?

profile pictureAWS
Jsc
已回答 10 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南