diff --git a/cdk/lib/__snapshots__/frontend.test.ts.snap b/cdk/lib/__snapshots__/frontend.test.ts.snap index 945293c9b0..eaacd52ce4 100644 --- a/cdk/lib/__snapshots__/frontend.test.ts.snap +++ b/cdk/lib/__snapshots__/frontend.test.ts.snap @@ -43,6 +43,7 @@ exports[`The Frontend stack matches the snapshot 1`] = ` "GuAlarm", "GuAlarm", "GuAlarm", + "GuAlarm", ], "gu:cdk:version": "TEST", }, @@ -1344,6 +1345,64 @@ exports[`The Frontend stack matches the snapshot 1`] = ` }, "Type": "AWS::CloudWatch::Alarm", }, + "ServerSideHighThresholdCreateFailureAlarm1DE4A5A9": { + "Properties": { + "ActionsEnabled": true, + "AlarmActions": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:sns:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":alarms-handler-topic-PROD", + ], + ], + }, + ], + "AlarmDescription": "Impact - Someone pressed buy on a recurring product but received an error. This has happened multiple times for a known reason.. Follow the process in https://docs.google.com/document/d/1_3El3cly9d7u_jPgTcRjLxmdG2e919zCLvmcFCLOYAk/edit", + "AlarmName": "Support-frontend create recurring product call failed multiple times for a known reason", + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "Dimensions": [ + { + "Name": "Stage", + "Value": "PROD", + }, + ], + "EvaluationPeriods": 60, + "MetricName": "ServerSideHighThresholdCreateFailure", + "Namespace": "support-frontend", + "Period": 60, + "Statistic": "Sum", + "Tags": [ + { + "Key": "gu:cdk:version", + "Value": "TEST", + }, + { + "Key": "gu:repo", + "Value": "guardian/support-frontend", + }, + { + "Key": "Stack", + "Value": "support", + }, + { + "Key": "Stage", + "Value": "PROD", + }, + ], + "Threshold": 10, + "TreatMissingData": "notBreaching", + }, + "Type": "AWS::CloudWatch::Alarm", + }, "SettingsBucket420EA4B0": { "Properties": { "PolicyDocument": { diff --git a/cdk/lib/frontend.ts b/cdk/lib/frontend.ts index 49195055d6..df9b3a5d77 100644 --- a/cdk/lib/frontend.ts +++ b/cdk/lib/frontend.ts @@ -331,6 +331,32 @@ export class Frontend extends GuStack { snsTopicName: `alarms-handler-topic-${this.stage}`, }); + new GuAlarm(this, "ServerSideHighThresholdCreateFailureAlarm", { + app, + alarmName: alarmName( + "support-frontend create recurring product call failed multiple times for a known reason" + ), + alarmDescription: alarmDescription( + "Someone pressed buy on a recurring product but received an error. This has happened multiple times for a known reason." + ), + actionsEnabled: shouldCreateAlarms, + threshold: 10, + evaluationPeriods: 60, + comparisonOperator: + ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD, + metric: new Metric({ + metricName: "ServerSideHighThresholdCreateFailure", + namespace: "support-frontend", + dimensionsMap: { + Stage: "PROD", + }, + statistic: "Sum", + period: Duration.minutes(1), + }), + treatMissingData: TreatMissingData.NOT_BREACHING, + snsTopicName: `alarms-handler-topic-${this.stage}`, + }); + new GuAlarm(this, "GetDeliveryAgentsFailure", { app, alarmName: alarmName("support-frontend GetDeliveryAgentsFailure"),