mirror of
https://github.com/Sea-Haven-Industries/afterhours-shift-manager.git
synced 2026-10-07 00:02:05 +00:00
Fix DynamoDB throttle alarm metric: use Read/WriteThrottleEvents
ThrottledRequests is not emitted at the TableName-only dimension (only TableName+Operation), so the table-level alarm would sit permanently in INSUFFICIENT_DATA and never fire. Replace with ReadThrottleEvents and WriteThrottleEvents, which AWS/DynamoDB emits at the TableName dimension.
This commit is contained in:
parent
38ab8a1487
commit
0a299d5525
1 changed files with 30 additions and 12 deletions
|
|
@ -786,27 +786,45 @@ Resources:
|
||||||
- !Sub "arn:aws:sns:${AWS::Region}:${AWS::AccountId}:site-alerts"
|
- !Sub "arn:aws:sns:${AWS::Region}:${AWS::AccountId}:site-alerts"
|
||||||
|
|
||||||
# --- DynamoDB alarms (afterhours-shifts table) ---
|
# --- DynamoDB alarms (afterhours-shifts table) ---
|
||||||
# ThrottledRequests emits at the TableName dimension → safe to alarm.
|
# ReadThrottleEvents / WriteThrottleEvents are the table-level throttle
|
||||||
# NOTE: SystemErrors is INTENTIONALLY OMITTED. AWS emits AWS/DynamoDB
|
# signals: AWS/DynamoDB emits them at the TableName dimension, so these
|
||||||
# SystemErrors only at TableName+Operation granularity, never TableName-only,
|
# alarms transition normally. (ThrottledRequests and SystemErrors are NOT
|
||||||
# so a TableName-only SystemErrors alarm would sit permanently in
|
# emitted at TableName-only granularity — only at TableName+Operation — so
|
||||||
# INSUFFICIENT_DATA. (Verified: no DynamoDB table in this account has ever
|
# alarms on them sit permanently in INSUFFICIENT_DATA and never fire.)
|
||||||
# emitted SystemErrors, consistent with documented per-Operation emission.)
|
ShiftTableReadThrottleAlarm:
|
||||||
ShiftTableThrottleAlarm:
|
|
||||||
Type: AWS::CloudWatch::Alarm
|
Type: AWS::CloudWatch::Alarm
|
||||||
Properties:
|
Properties:
|
||||||
AlarmName: !Sub "DynamoDB-ThrottledRequests-${ShiftTable}"
|
AlarmName: !Sub "DDB-ReadThrottle-${ShiftTable}"
|
||||||
AlarmDescription: "afterhours-shifts table had one or more throttled requests"
|
AlarmDescription: "afterhours-shifts table had one or more read throttle events"
|
||||||
Namespace: AWS/DynamoDB
|
Namespace: AWS/DynamoDB
|
||||||
MetricName: ThrottledRequests
|
MetricName: ReadThrottleEvents
|
||||||
Dimensions:
|
Dimensions:
|
||||||
- Name: TableName
|
- Name: TableName
|
||||||
Value: !Ref ShiftTable
|
Value: !Ref ShiftTable
|
||||||
Statistic: Sum
|
Statistic: Sum
|
||||||
Period: 300
|
Period: 300
|
||||||
EvaluationPeriods: 1
|
EvaluationPeriods: 1
|
||||||
Threshold: 1
|
Threshold: 0
|
||||||
ComparisonOperator: GreaterThanOrEqualToThreshold
|
ComparisonOperator: GreaterThanThreshold
|
||||||
|
TreatMissingData: notBreaching
|
||||||
|
AlarmActions:
|
||||||
|
- !Sub "arn:aws:sns:${AWS::Region}:${AWS::AccountId}:site-alerts"
|
||||||
|
|
||||||
|
ShiftTableWriteThrottleAlarm:
|
||||||
|
Type: AWS::CloudWatch::Alarm
|
||||||
|
Properties:
|
||||||
|
AlarmName: !Sub "DDB-WriteThrottle-${ShiftTable}"
|
||||||
|
AlarmDescription: "afterhours-shifts table had one or more write throttle events"
|
||||||
|
Namespace: AWS/DynamoDB
|
||||||
|
MetricName: WriteThrottleEvents
|
||||||
|
Dimensions:
|
||||||
|
- Name: TableName
|
||||||
|
Value: !Ref ShiftTable
|
||||||
|
Statistic: Sum
|
||||||
|
Period: 300
|
||||||
|
EvaluationPeriods: 1
|
||||||
|
Threshold: 0
|
||||||
|
ComparisonOperator: GreaterThanThreshold
|
||||||
TreatMissingData: notBreaching
|
TreatMissingData: notBreaching
|
||||||
AlarmActions:
|
AlarmActions:
|
||||||
- !Sub "arn:aws:sns:${AWS::Region}:${AWS::AccountId}:site-alerts"
|
- !Sub "arn:aws:sns:${AWS::Region}:${AWS::AccountId}:site-alerts"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue