Skip to content

Commit 2629c84

Browse files
PYIC-8855: add HTTPCode_ELB_5XX_Count to canary alarm and re-name alarm (#2524)
2 parents 25ad047 + a1620ee commit 2629c84

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

deploy/template.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,15 +1734,15 @@ Resources:
17341734
Period: !FindInMap [ EnvironmentConfiguration, !Ref AWS::AccountId, tg500ErrorWindow ]
17351735
Stat: Sum
17361736

1737-
FrontTargetGroup5xxPercentErrors:
1737+
FrontTargetGroupAndELB5xxPercentErrors:
17381738
# This is used by the canary deployment stack
17391739
Type: AWS::CloudWatch::Alarm
17401740
Condition: UseCanaryDeployment
17411741
Properties:
1742-
AlarmName: FrontTargetGroup5xxPercentAlarm
1742+
AlarmName: FrontTargetGroupAndELB5xxPercentAlarm
17431743
AlarmDescription: >
1744-
The number of HTTP 5XX server error codes that originate from the
1745-
target group is greater than 5% of all traffic.
1744+
The sum of HTTP 5XX server error codes that originate from the
1745+
target group and the application load balancer is greater than 5% of all traffic.
17461746
EvaluationPeriods: 2
17471747
DatapointsToAlarm: 2
17481748
Threshold: 5
@@ -1752,7 +1752,7 @@ Resources:
17521752
- Id: e1
17531753
Label: ErrorPercent
17541754
ReturnData: true
1755-
Expression: (m1/m2)*100
1755+
Expression: ((m1+m3)/m2)*100
17561756
- Id: m1
17571757
ReturnData: false
17581758
MetricStat:
@@ -1775,6 +1775,17 @@ Resources:
17751775
Value: !GetAtt PrivateLoadBalancer.LoadBalancerFullName
17761776
Period: 60
17771777
Stat: Sum
1778+
- Id: m3
1779+
ReturnData: false
1780+
MetricStat:
1781+
Metric:
1782+
Namespace: AWS/ApplicationELB
1783+
MetricName: HTTPCode_ELB_5XX_Count
1784+
Dimensions:
1785+
- Name: LoadBalancer
1786+
Value: !GetAtt PrivateLoadBalancer.LoadBalancerFullName
1787+
Period: 60
1788+
Stat: Sum
17781789

17791790
FrontRestApiGateway5XXErrorAlarm:
17801791
# This is monitoring all 5XXs returned by the frontend REST API gatway.
@@ -2021,7 +2032,7 @@ Resources:
20212032
VpcId: !Sub ${VpcStackName}-VpcId
20222033
ContainerName: app
20232034
ContainerPort: 8080
2024-
CloudWatchAlarms: !Ref FrontTargetGroup5xxPercentErrors
2035+
CloudWatchAlarms: !Ref FrontTargetGroupAndELB5xxPercentErrors
20252036
PermissionsBoundary: !If
20262037
- UsePermissionsBoundary
20272038
- !Ref PermissionsBoundary

0 commit comments

Comments
 (0)