feat(rds): add Read/Write IOPS metrics to DatabaseInstance and VolumeRead/Write IOPs metrics to DatabaseCluster#35773
Conversation
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
@pahud This PR is ready for review! |
38157e0 to
31788ad
Compare
|
Thank you for your contribution! |
ozelalisen
left a comment
There was a problem hiding this comment.
You have merge conflicts too
| * Represents the average of the ReadIOPS values across all instances in the cluster. | ||
| */ | ||
| public metricReadIOPS(props?: cloudwatch.MetricOptions) { | ||
| return this.metric('ReadIOPS', { statistic: 'Average', ...props }); |
There was a problem hiding this comment.
This metric is not available on cluster level, checking docs here: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.AuroraMonitoring.Metrics.html, could you please move this metric implementation to instance, because this would give an empty metric. For cluster level, we should use VolumeReadIOPs, but I do not see this metric is also available within CDK, so feel free to update this metric as VolumeReadIOPs and add ReadIOPS in instance level metrics.
There was a problem hiding this comment.
Thats a good catch @ozelalisen. I have updated the code to add Read/Write IOPS for DB Instance, and Volume Read/Write IOPS for DB Cluster.
…eReadIOPs to DatabaseCluster
Pull request has been modified.
…Read/Write IOPs metrics to DatabaseCluster
ozelalisen
left a comment
There was a problem hiding this comment.
PR Build is failing, you need to update snapshots
| cdkCommandOptions: { | ||
| deploy: { | ||
| args: { | ||
| rollback: true, | ||
| }, |
There was a problem hiding this comment.
No need to specify these arguments
| cdkCommandOptions: { | ||
| deploy: { | ||
| args: { | ||
| rollback: true, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
No need to provide these arguments
|
|
||
| const app = new cdk.App(); | ||
| const stack = new cdk.Stack(app, 'aws-cdk-rds-instance-iops-metric', { | ||
| terminationProtection: false, |
|
|
||
| const app = new cdk.App(); | ||
| const stack = new cdk.Stack(app, 'aws-cdk-rds-cluster-volume-iops-metric', { | ||
| terminationProtection: false, |
| const vpc = new ec2.Vpc(stack, 'VPC', { maxAzs: 2, restrictDefaultSecurityGroup: false }); | ||
|
|
||
| const instance = new rds.DatabaseInstance(stack, 'Instance', { | ||
| engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_16 }), |
| engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_16 }), | ||
| vpc, | ||
| multiAz: false, | ||
| publiclyAccessible: true, |
Pull request has been modified.
…Read/Write IOPs metrics to DatabaseCluster
ozelalisen
left a comment
There was a problem hiding this comment.
You should add snapshots for integ tests, build is failing due to that
…Read/Write IOPs metrics to DatabaseCluster
|
@ozelalisen Added the integration tests, this PR is ready for review. |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
ozelalisen
left a comment
There was a problem hiding this comment.
Have some final comments regarding instance level metric configuration, see reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/appinsights-metrics-rds.html
| * @default - average over 5 minutes | ||
| */ | ||
| public metricReadIOPs(props?: cloudwatch.MetricOptions) { | ||
| return this.metric('ReadIOPs', { statistic: 'Average', ...props }); |
There was a problem hiding this comment.
This should be ReadIOPS, all capital, this will return empty CW metric
| return this.metric('ReadIOPs', { statistic: 'Average', ...props }); | |
| return this.metric('ReadIOPS', { statistic: 'Average', ...props }); |
There was a problem hiding this comment.
Sorry for my other comment regarding Aurora restriction, for instance level this is supported for all, let's remove incorrect doc above regarding restriction
There was a problem hiding this comment.
aah ok, updated 👍
| * @default - average over 5 minutes | ||
| */ | ||
| public metricWriteIOPs(props?: cloudwatch.MetricOptions) { | ||
| return this.metric('WriteIOPs', { statistic: 'Average', ...props }); |
There was a problem hiding this comment.
Should be capital
| return this.metric('WriteIOPs', { statistic: 'Average', ...props }); | |
| return this.metric('WriteIOPS', { statistic: 'Average', ...props }); |
There was a problem hiding this comment.
Sorry for my other comment regarding Aurora restriction, for instance level this is supported for all, let's remove incorrect doc above regarding restriction
There was a problem hiding this comment.
aah ok, updated 👍
0655cb5 to
6fb924e
Compare
…Read/Write IOPs metrics to DatabaseCluster
Pull request has been modified.
ozelalisen
left a comment
There was a problem hiding this comment.
LGTM, thanks for addressing all comments!
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Merge Queue Status✅ The pull request has been merged at a95ed2e This pull request spent 42 minutes 1 second in the queue, including 41 minutes 51 seconds running CI. Required conditions to merge
|
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue #35327
Closes #35327.
Reason for this change
Users cannot easily track
ReadIOPs/WriteIOPsat the instance-level andVolumeReadIOPs/VolumeWriteIOPsat the cluster level.Description of changes
This change adds support for additional Amazon RDS IOPS CloudWatch metrics to improve observability for both database instances and clusters.
New metrics introduced:
metricReadIOPS()metricWriteIOPS()Instance Level metrics are supported as per these docs
metricVolumeReadIOPs()metricVolumeWriteIOPs()Cluster Level metrics are supported as per these docs
These metrics align with existing RDS CloudWatch metrics and follow the same conventions as other metric helpers in the CDK.
Changes included
Describe any new or updated permissions being added
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license