You can install and configure the NRDOT Collector for PostgreSQL monitoring using the newrelic.newrelic_install Ansible role. The role installs the collector, creates the monitoring role and its grants, and configures the collector in a single play.
Prerequisites
- A New Relic account with a valid license key.
- A New Relic account ID.
- PostgreSQL 14 or later.
- Ansible Core 2.13 or 2.14, Python 3.10, and the
ansible.windowsandansible.utilscollections. - A Linux collector host running Debian/Ubuntu or RHEL/CentOS.
pg_stat_statementsmust be loaded viashared_preload_libraries, which requires a database restart. Put the server-level prerequisites in place before running the playbook.- For self-hosted PostgreSQL: administrative access to your PostgreSQL server (the
postgressuperuser or equivalent), with a password set andpg_hba.confpermitting password-based host authentication. - For PostgreSQL or Aurora on AWS RDS: network connectivity from the collector host to the RDS endpoint, and the RDS master username and password.
- Network connectivity to New Relic OTLP endpoint for your region.
For detailed requirements, refer to Compatibility.
Install the role
$ansible-galaxy install newrelic.newrelic_installMake sure the required collections are also installed:
$ansible-galaxy collection install ansible.windows ansible.utilsConfigure the playbook
Run the playbook
$ansible-playbook -i <inventory_file> <playbook_file>.ymlFind and use your data
Once your data is being collected, you can access comprehensive PostgreSQL database monitoring through the New Relic UI.
To find your PostgreSQL database entity in New Relic:
- Go to one.newrelic.com > All capabilities > Databases.
- From the Entity type dropdown, select PostgreSQL instance, then click Apply.
- Select your PostgreSQL database from the list of entities.
Related documentation
Introduction to PostgreSQL monitoring with NRDOT
Learn about all the available installation methods for PostgreSQL monitoring with New Relic.
CLI install
Learn how to install and configure PostgreSQL monitoring with a single New Relic CLI command.
Chef install
Learn how to install and configure PostgreSQL monitoring at scale with the newrelic-install Chef cookbook.
Helm chart install
Learn how to install and configure PostgreSQL monitoring on Kubernetes with the postgresql-otel Helm chart.