-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metric Push API: Only alarm on 2xx errors #2655
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,17 +9,16 @@ Parameters: | |
- PROD | ||
- CODE | ||
|
||
Conditions: | ||
CreateProdMonitoring: !Equals [ !Ref Stage, PROD ] | ||
|
||
Mappings: | ||
StageMap: | ||
CODE: | ||
ApiName: metric-push-api-api-CODE | ||
DomainName: metric-push-api-code.support.guardianapis.com | ||
AlarmActionsEnabled: FALSE | ||
PROD: | ||
ApiName: metric-push-api-api-PROD | ||
DomainName: metric-push-api-prod.support.guardianapis.com | ||
AlarmActionsEnabled: TRUE | ||
Constants: | ||
Alarm: | ||
Process: Follow the process in https://docs.google.com/document/d/1_3El3cly9d7u_jPgTcRjLxmdG2e919zCLvmcFCLOYAk/edit | ||
|
@@ -122,10 +121,10 @@ Resources: | |
|
||
5xxApiAlarm: | ||
Type: AWS::CloudWatch::Alarm | ||
Condition: CreateProdMonitoring | ||
Properties: | ||
AlarmActions: | ||
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:alarms-handler-topic-${Stage} | ||
ActionsEnabled: !FindInMap [StageMap, !Ref Stage, AlarmActionsEnabled] | ||
AlarmName: !Join | ||
- ' ' | ||
- - !FindInMap [ Constants, Alarm, Urgent ] | ||
|
@@ -148,10 +147,10 @@ Resources: | |
|
||
HighClientSideErrorRateAlarm: | ||
Type: AWS::CloudWatch::Alarm | ||
Condition: CreateProdMonitoring | ||
Properties: | ||
AlarmActions: | ||
- !Sub arn:aws:sns:${AWS::Region}:${AWS::AccountId}:alarms-handler-topic-${Stage} | ||
ActionsEnabled: !FindInMap [StageMap, !Ref Stage, AlarmActionsEnabled] | ||
AlarmName: !Join | ||
- ' ' | ||
- - !FindInMap [ Constants, Alarm, Urgent ] | ||
|
@@ -162,17 +161,46 @@ Resources: | |
- - 'Impact - some or all browsers are failing to render support client side pages. Log in to Sentry to see these errors: https://the-guardian.sentry.io/discover/results/?project=1213654&query=%22Fatal%20error%20rendering%20page%22&queryDataset=error-events&sort=-count&statsPeriod=24h' | ||
- !FindInMap [ Constants, Alarm, Process ] | ||
- !FindInMap [StageMap, !Ref Stage, ApiName] | ||
MetricName: Count | ||
Namespace: AWS/ApiGateway | ||
Dimensions: | ||
- Name: ApiName | ||
Value: !FindInMap [StageMap, !Ref Stage, ApiName] | ||
Metrics: | ||
- Id: mtotal2xx | ||
Expression: 'mtotalcount - (m5xxcount + m4xxcount)' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it does seem sparse that we get so few metrics to look at comapred with what Load balancers have. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I know! It's surprising we have to derive this ourselves. |
||
- Id: mtotalcount | ||
ReturnData: false | ||
MetricStat: | ||
Period: 60 | ||
Stat: Sum | ||
Metric: | ||
Namespace: AWS/ApiGateway | ||
MetricName: Count | ||
Dimensions: | ||
- Name: ApiName | ||
Value: !FindInMap [StageMap, !Ref Stage, ApiName] | ||
- Id: m5xxcount | ||
ReturnData: false | ||
MetricStat: | ||
Period: 60 | ||
Stat: Sum | ||
Metric: | ||
Namespace: AWS/ApiGateway | ||
MetricName: 5XXError | ||
Dimensions: | ||
- Name: ApiName | ||
Value: !FindInMap [StageMap, !Ref Stage, ApiName] | ||
- Id: m4xxcount | ||
ReturnData: false | ||
MetricStat: | ||
Period: 60 | ||
Stat: Sum | ||
Metric: | ||
Namespace: AWS/ApiGateway | ||
MetricName: 4XXError | ||
Dimensions: | ||
- Name: ApiName | ||
Value: !FindInMap [StageMap, !Ref Stage, ApiName] | ||
ComparisonOperator: GreaterThanOrEqualToThreshold | ||
Threshold: 2 | ||
DatapointsToAlarm: 3 | ||
Period: 60 | ||
EvaluationPeriods: 5 | ||
Statistic: Sum | ||
TreatMissingData: notBreaching | ||
DependsOn: | ||
- MetricPushAPI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is to update it to have the alarm in PROD and CODE, but we just don't trigger in CODE.
I personally think that makes it easier to test so I approve 👍 even with the extra clutter in the AWS console.