Skip to content

Commit 62cbfa9

Browse files
update feedback api alarm threshold (#132)
<!-- Please complete the following sections as necessary. --> ### Description <!-- Summary of the changes, related issue, relevant motivation, and context --> This PR increases the Feedback Widget API alarm threshold for the 5xx error to reduce alarm noise. ### Ticket <!-- Link to ticket in pivotal. Append ticket_id to provided URL. --> [[chore]: Update Feedback Widget Alarm Threshold](newjersey/innovation-platform-pm#1395) ### Approach <!-- Any changed dependencies, e.g. requires an install/update/migration, etc. --> ### Steps to Test <!-- If this work affects a user's experience, provide steps to test these changes in-app. --> ### Notes <!-- Additional information, key learnings, and future development considerations. -->
2 parents f6c635f + 6d0cc74 commit 62cbfa9

3 files changed

Lines changed: 18 additions & 9 deletions

File tree

infra/monitoring/feedback-api-5xx-error-alarm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export class FeedbackApi5xxErrorAlarm extends Construct {
2222
const feedbackApi5xxErrorsAlarm = new cloudwatch.Alarm(this, id, {
2323
metric,
2424
evaluationPeriods: 1,
25-
threshold: 2,
25+
threshold: 5,
2626
actionsEnabled: true,
2727
alarmDescription:
28-
'Alarm when the Feedback API returns over 2 5XX errors in 15 minutes',
28+
'Alarm when the Feedback API returns over 5 5XX errors in 15 minutes',
2929
alarmName: 'Feedback API - 5XX Errors',
3030
comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD,
3131
datapointsToAlarm: 1,

infra/test/feedback-api-stack.test.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,25 @@ describe('Feedback API Stack', () => {
111111
valueForStringParameterMock.mockRestore();
112112
});
113113

114-
it.each(['4XXError', '5XXError'])(
115-
'creates a CloudWatch alarm tracking the %s metric',
116-
(metricName) => {
114+
describe('CloudWatch alarms', () => {
115+
it('creates a CloudWatch alarm tracking the 4XXError metric with threshold of 2', () => {
117116
const { template } = createStackAndTemplate();
118117
template.hasResourceProperties('AWS::CloudWatch::Alarm', {
119-
MetricName: metricName,
118+
MetricName: '4XXError',
120119
Threshold: 2,
121120
EvaluationPeriods: 1,
122121
Period: 900 // seconds
123122
});
124-
}
125-
);
123+
});
124+
125+
it('creates a CloudWatch alarm tracking the 5XXError metric with threshold of 5', () => {
126+
const { template } = createStackAndTemplate();
127+
template.hasResourceProperties('AWS::CloudWatch::Alarm', {
128+
MetricName: '5XXError',
129+
Threshold: 5,
130+
EvaluationPeriods: 1,
131+
Period: 900 // seconds
132+
});
133+
});
134+
});
126135
});

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"target": "ES2022",
2424
"types": ["jest", "node"]
2525
},
26-
"include": ["src/**/*.ts"],
26+
"include": ["src/**/*.ts", "infra/test/**/*.ts"],
2727
"exclude": [
2828
"node_modules/**/*",
2929
".webpack/**/*",

0 commit comments

Comments
 (0)