Skip to content

feat(cw): handle alerts with multiple metrics - #98

Open
rfvermut wants to merge 1 commit into
arabold:masterfrom
rfvermut:patch-1
Open

feat(cw): handle alerts with multiple metrics#98
rfvermut wants to merge 1 commit into
arabold:masterfrom
rfvermut:patch-1

Conversation

@rfvermut

@rfvermut rfvermut commented Feb 9, 2021

Copy link
Copy Markdown

i.e. anomaly detection alerts

sample event:

{
  "Records": [
    {
      "EventSource": "aws:sns",
      "EventVersion": "1.0",
      "EventSubscriptionArn": "arn:aws:sns:us-east-1:AAAAXXXXX:data--alerts:34a7b0cb-3f8c-4471-aea2-2bbc7c4eacc9",
      "Sns": {
        "Type": "Notification",
        "MessageId": "6b034f0c-b465-58da-a999-179029ec5364",
        "TopicArn": "arn:aws:sns:us-east-1:AAAAXXXXX:data--alerts",
        "Subject": "OK: \"text-CryptosFunctionInvocationsAlarm-G6D30JIL9N7T\" in US East (N. Virginia)",
        "Message": "{\"AlarmName\":\"text-CryptosFunctionInvocationsAlarm-G6D30JIL9N7T\",\"AlarmDescription\":null,\"AWSAccountId\":\"AAAAXXXXX\",\"NewStateValue\":\"OK\",\"NewStateReason\":\"Thresholds Crossed: 1 out of the last 5 datapoints [1.0 (09/02/21 14:23:00)] was not less than the lower thresholds [0.96] or not greater than the upper thresholds [1.04] (minimum 3 datapoints for ALARM -> OK transition).\",\"StateChangeTime\":\"2021-02-09T14:25:13.236+0000\",\"Region\":\"US East (N. Virginia)\",\"AlarmArn\":\"arn:aws:cloudwatch:us-east-1:AAAAXXXXX:alarm:text-CryptosFunctionInvocationsAlarm-G6D30JIL9N7T\",\"OldStateValue\":\"INSUFFICIENT_DATA\",\"Trigger\":{\"Period\":60,\"EvaluationPeriods\":5,\"ComparisonOperator\":\"LessThanLowerOrGreaterThanUpperThreshold\",\"ThresholdMetricId\":\"ad1\",\"TreatMissingData\":\"- TreatMissingData:                    missing\",\"EvaluateLowSampleCountPercentile\":\"\",\"Metrics\":[{\"Id\":\"m1\",\"MetricStat\":{\"Metric\":{\"Dimensions\":[{\"value\":\"text-cryptos\",\"name\":\"FunctionName\"}],\"MetricName\":\"Invocations\",\"Namespace\":\"AWS/Lambda\"},\"Period\":60,\"Stat\":\"Average\"},\"ReturnData\":true},{\"Expression\":\"ANOMALY_DETECTION_BAND(m1, 2)\",\"Id\":\"ad1\",\"Label\":\"Invocations (expected)\",\"ReturnData\":true}]}}",
        "Timestamp": "2021-02-09T14:25:13.277Z",
        "SignatureVersion": "1",
        "Signature": "phodF/+ksm24Zc85XbCxHo+HhIz1f0d71NV8bGhWT1KfBY4NKPj9K+18f+DxZO2U74TFs+ZrGEKZ8YMDAlptjkbcrMQ4N4R5RP4yk5oQDQxDG0abLJITWEsZqmZNkxa37mdNsY0phJ1F0wAZTB8IdxIehNzkBJqDMnSJeMaYYnDmTXo53vIb5HLAUamoxak/rvpUX1FyGCnWgwc+xLU47X9uHjKvriGnQSQSQLu5+Tc0fP8I7NS2zDIK1XZKs8SZeclkx1XPE3yPS5W9R335A1XqKG+QMdCObJKZ5S6umOFxaEMuJQeSlrtA9DgEfDO3/VUUwOHBIUll9z0mgQ8fmw==",
        "SigningCertUrl": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-010a507c1833636cd94bdb98bd93083a.pem",
        "UnsubscribeUrl": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:AAAAXXXXX:data--alerts:34a7b0cb-3f8c-4471-aea2-2bbc7c4eacc9",
        "MessageAttributes": {}
      }
    }
  ]
}

i.e. anomaly detection alerts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant