Aurora RDS Postgres DB alerts by query execution latency


Hi fam,

I have this requirement, DB alerts by query execution latency , this means we need to set alarm one of our query running more that 5 second. but i did not find any metric regarding this.

asked 6 months ago224 views
1 Answer
Accepted Answer


As you may know, RDS metrics do not include metrics related to slow queries.
So, enable query logging for RDS PostgreSQL and change "log_statement" to 1 in the RDS parameter group.
Also, by setting the value of "log_min_duration_statement" to 5000, queries that take more than 5 seconds to execute will be output to the log.
Please set the type of query you want to output to the log with the value of "log_statement".

After outputting to CloudWatch Logs, you can create metrics by using a metric filter, etc., and then you can create alarms.

profile picture
answered 6 months ago
profile picture
reviewed 3 months ago
  • thank you so much Riku, its work

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions