I did a little preliminary research today on how to measure postgres performance, including on AWS.
How Postgres query performance measurement works
Postgres can be configured to log query-related data.
These logs can be exported to tools like pgbadger or hosted tools like pganalyze. Datadog seems to have some options, too.
Postgres query measurement on RDS
With postgres on AWS RDS, you need to do some extra configuration.
- pganalyze AWS setup steps: https://pganalyze.com/docs/install/amazon_rds
- how to consume AWS log format with pgbadger: https://forums.aws.amazon.com/thread.jspa?threadID=145342
- AWS setup notes on SO: https://stackoverflow.com/questions/31330740/how-do-you-enable-the-logging-of-all-queries-to-postgresql-aws-rds-instance
- pgbadger howto: http://www.pateldenish.com/2015/10/pgbadger-log-analysis-for-postgres-rds-instances.html
Mozilla's default Postgres-Datadog monitoring level
Currently / by default, Mozilla's datadog install has instance-level data about RDS instances (machine stats like CPU or IOPS usage):