-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
…comingBytes (#31535) ### Issue Closes #30034 ### Reason for this change - Create alarms on log ingestion to ensure it is working ### Description of changes - Add metric methods for log group IncomingLogEvents and IncomingBytes, similar to existing metric methods like metricInvocations on Lambda functions. ### Description of how you validated changes - validated with new unit tests and a new integration test ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"Resources": { | ||
"MyLogGroup5C0DAD85": { | ||
"Type": "AWS::Logs::LogGroup", | ||
"Properties": { | ||
"LogGroupName": "my-log-group", | ||
"RetentionInDays": 731 | ||
}, | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
}, | ||
"IncomingBytesPerInstanceAlarmFA8EEFDB": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanOrEqualToThreshold", | ||
"EvaluationPeriods": 1, | ||
"MetricName": "IncomingBytes", | ||
"Namespace": "AWS/Logs", | ||
"Period": 300, | ||
"Statistic": "Sum", | ||
"Threshold": 1 | ||
} | ||
}, | ||
"IncomingEventsPerInstanceAlarmA9670D55": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanOrEqualToThreshold", | ||
"EvaluationPeriods": 1, | ||
"MetricName": "IncomingLogs", | ||
"Namespace": "AWS/Logs", | ||
"Period": 300, | ||
"Statistic": "Sum", | ||
"Threshold": 1 | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.