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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ