Publishing Performance Insights metrics to CloudWatch - AWS Prescriptive Guidance

Publishing Performance Insights metrics to CloudWatch

Amazon RDS Performance Insights monitors most of the DB instance metrics and dimensions and makes them available through the Performance Insights dashboard in the AWS Management Console. This dashboard is well-suited for database troubleshooting and root cause analysis. However, it is not possible to create alarms in Performance Insights for performance-related metrics. To create alarms based on Performance Insights metrics, you have to move those metrics to CloudWatch. Having the metrics in CloudWatch also gives you access to advanced monitoring features such as CloudWatch anomaly detection, metric math, and statistics, and you can export the metrics to external monitoring tools such as Prometheus and Grafana.

Performance Insights metrics aren't automatically published to CloudWatch (except for the DBLoad metric). To publish the DB instance metrics from Performance Insights to CloudWatch, you can use the Performance Insights API to retrieve metrics, and the CloudWatch API to publish metrics to CloudWatch. To automate the process, you can create a Lambda function and schedule it in Amazon EventBridge to run at specified time periods―for example, every two minutes. You can specify which Performance Insights metrics you want to publish to CloudWatch. The Lambda function gets those metrics from all the Amazon RDS instances that have Performance Insights enabled, and saves the metrics in CloudWatch. For more information about this process, see the blog post about delivering Performance Insights counter metrics to CloudWatch.