in src/rds-aurora.ts [57:111]
constructor(scope: Construct, id: string, props: WatchRdsAuroraProps) {
super(scope, id);
this.watchful = props.watchful;
this.cluster = props.cluster;
this.metrics = new RdsAuroraMetricFactory();
this.watchful.addSection(props.title, {
links: [
{ title: 'AWS RDS Cluster', url: linkForRDS(this.cluster) },
],
});
const { cpuUtilizationMetric, cpuUtilizationAlarm } = this.createCpuUtilizationMonitor(props.cpuMaximumThresholdPercent);
const { dbConnectionsMetric, dbConnectionsAlarm } = this.createDbConnectionsMonitor(props.dbConnectionsMaximumThreshold);
const { dbReplicaLagMetric, dbReplicaLagAlarm } = this.createDbReplicaLagMonitor(props.dbReplicaLagMaximumThreshold);
const { dbBufferCacheHitRatioMetric, dbBufferCacheHitRatioAlarm } = this.createDbBufferCacheMonitor(props.dbBufferCacheMinimumThreshold);
const { dbInsertThroughputMetric, dbUpdateThroughputMetric, dbSelectThroughputMetric, dbDeleteThroughputMetric } =
this.createDbDmlThroughputMonitor(props.dbThroughputMaximumThreshold);
this.watchful.addWidgets(
new cloudwatch.GraphWidget({
title: `CPUUtilization/${cpuUtilizationMetric.period.toMinutes()}min`,
width: 6,
left: [cpuUtilizationMetric],
leftAnnotations: [cpuUtilizationAlarm.toAnnotation()],
}),
new cloudwatch.GraphWidget({
title: `DB Connections/${dbConnectionsMetric.period.toMinutes()}min`,
width: 6,
left: [dbConnectionsMetric],
leftAnnotations: [dbConnectionsAlarm.toAnnotation()],
}),
new cloudwatch.GraphWidget({
title: `DB Replica Lag/${dbReplicaLagMetric.period.toMinutes()}min`,
width: 6,
left: [dbReplicaLagMetric],
leftAnnotations: [dbReplicaLagAlarm.toAnnotation()],
}),
new cloudwatch.GraphWidget({
title: `DB BufferCache Hit Ratio/${dbBufferCacheHitRatioMetric.period.toMinutes()}min`,
width: 6,
left: [dbBufferCacheHitRatioMetric],
leftAnnotations: [dbBufferCacheHitRatioAlarm.toAnnotation()],
}),
);
this.watchful.addWidgets(
new cloudwatch.GraphWidget({
title: 'RDS DML Overview',
width: 24,
left: [dbInsertThroughputMetric, dbUpdateThroughputMetric, dbSelectThroughputMetric, dbDeleteThroughputMetric],
}),
);
}