I would like to use a monitoring service like Datadog and I need to grant my Heroku Postgres user the
For production plans, the default credential for Heroku Postgres databases has
pg_monitor privileges and it can grant this membership to other credentials/users in the database.
To grant the
pg_monitor role to a custom credential, connect to the database with your default credential, and run:
GRANT pg_monitor TO <credential_name>;
When granting the
pg_monitor role to a credential it will also inherit the
pg_stat_scan_tables roles - see "Predefined Roles" in the PostgreSQL documentation.
Note: Due to the multi-tenancy setup of Hobby, Mini, and Basic databases,
pg_monitor permissions can't be granted on these plans for security and privacy reasons.