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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠