-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rds): add support for Aurora Serverless Clusters (#395)
Added new AuroraCluster Monitoring with Aurora specific metrics/alarms. Fixes #217 --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
- Loading branch information
Showing
13 changed files
with
2,415 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { | ||
ComparisonOperator, | ||
TreatMissingData, | ||
} from "aws-cdk-lib/aws-cloudwatch"; | ||
|
||
import { AlarmFactory, CustomAlarmThreshold } from "../../alarm"; | ||
import { MetricWithAlarmSupport } from "../../metric"; | ||
|
||
export interface HighServerlessDatabaseCapacityThreshold | ||
extends CustomAlarmThreshold { | ||
readonly maxServerlessDatabaseCapacity: number; | ||
} | ||
|
||
export class AuroraAlarmFactory { | ||
protected readonly alarmFactory: AlarmFactory; | ||
|
||
constructor(alarmFactory: AlarmFactory) { | ||
this.alarmFactory = alarmFactory; | ||
} | ||
|
||
addMaxServerlessDatabaseCapacity( | ||
metric: MetricWithAlarmSupport, | ||
props: HighServerlessDatabaseCapacityThreshold, | ||
disambiguator?: string | ||
) { | ||
return this.alarmFactory.addAlarm(metric, { | ||
treatMissingData: | ||
props.treatMissingDataOverride ?? TreatMissingData.MISSING, | ||
comparisonOperator: | ||
props.comparisonOperatorOverride ?? | ||
ComparisonOperator.GREATER_THAN_THRESHOLD, | ||
...props, | ||
disambiguator, | ||
threshold: props.maxServerlessDatabaseCapacity, | ||
alarmNameSuffix: "Serverless-Database-Capacity-High", | ||
alarmDescription: "Serverless Database Capacity usage is too high.", | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.