- Newest
- Most votes
- Most comments
Hi there,
Looks like you need to combine multiple pieces here:
-
Query Blocking queries: --https://repost.aws/knowledge-center/rds-aurora-postgresql-query-blocked
-
Run cron jobs periodically to check if blocking exists and put them in user created table: --https://aws.amazon.com/blogs/database/schedule-jobs-with-pg_cron-on-your-amazon-rds-for-postgresql-or-amazon-aurora-for-postgresql-databases/ --https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL_pg_cron.html
-
Send an email: --https://aws.amazon.com/blogs/database/sending-notifications-from-amazon-aurora-postgresql/
Hi Jeremy, have you tried this?
-
Enabling Enhanced Monitoring: Start by enabling Enhanced Monitoring for your RDS or Aurora instance. You can enable Enhanced Monitoring when creating a new instance or modify an existing one. You can select the desired granularity level (e.g., 1 second, 10 seconds, etc.) depending on your needs.
-
Set up CloudWatch Alarms: Once Enhanced Monitoring is enabled, you can set up CloudWatch Alarms to monitor for blocking locks. In the metrics list, search for the relevant metric related to locks. It might be under the "Database" or "PostgreSQL" namespace, and the metric name might contain "lock" or "blocking." Define your threshold for the alarm.
-
Set Up Actions: Define actions to take when the alarm state is triggered. Common actions include sending notifications through Amazon SNS (Simple Notification Service), executing an AWS Lambda function, or running a custom script.
-
Notification Configuration: Configure your notification targets (e.g., email, SMS, or a webhook) to receive alerts when the alarm state changes (e.g., from OK to ALARM).
[Blog Post Link that might help] https://aws.amazon.com/blogs/database/monitor-amazon-rds-for-postgresql-and-amazon-aurora-for-postgresql-database-log-errors-and-set-up-notifications-using-amazon-cloudwatch/
- Publish the PostgreSQL log to CloudWatch Logs.
- Create an SNS topic.
- Create an SNS subscription.
- Create a metric filter on the log group in CloudWatch Logs.
- Create an alarm in CloudWatch.
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Blocking locks are not reported in cloudwatch. I've looked into this extensively already.