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
已回答 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则