You can install and configure the NRDOT Collector for PostgreSQL monitoring using the New Relic CLI. The CLI installs the collector, creates the monitoring role and its grants, and configures the collector in a single command.
Prerequisites
- A New Relic account with a valid license key.
- A New Relic account ID.
- PostgreSQL 14 or later.
- A Linux collector host running Debian/Ubuntu or RHEL/CentOS, with
curlandsystemdinstalled, and thepsqlclient available. pg_stat_statementsmust be loaded viashared_preload_libraries. The installer checks this and fails if it isn't. See Server-level prerequisites below.- For self-hosted PostgreSQL: administrative access to your PostgreSQL server (the
postgressuperuser or equivalent). - For AWS RDS/Aurora PostgreSQL: network connectivity from the collector host to the RDS endpoint (inbound access on the PostgreSQL port in the RDS security group), and the RDS master username and password.
- Network connectivity to New Relic OTLP endpoint for your region.
For detailed requirements, refer to Compatibility.
Server-level prerequisites
pg_stat_statements can't be created without shared_preload_libraries, and that parameter requires a database restart, so the CLI can't configure it for you. Put these parameters in place before running the install:
Parameter | Value |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
- Self-hosted: set these in
postgresql.conf, then restart PostgreSQL. Some distributions need thepostgresql-contribpackage installed forpg_stat_statementsto be available. - AWS RDS or Aurora: set these in the DB parameter group, not a config file.
track_activity_query_sizeandpg_stat_statements.maxare static parameters: apply them withapply_method: pending-reboot, then reboot the instance. For Aurora, the parameter-group family name must match your engine's major version exactly, for exampleaurora-postgresql16.
Install and configure the NRDOT Collector
Find 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.
To confirm data is arriving, run this query in the query builder:
SELECT count(*) FROM MetricWHERE metricName LIKE 'postgresql.%'AND instrumentation.provider = 'opentelemetry'SINCE 10 minutes agoRelated documentation
Introduction to PostgreSQL monitoring with NRDOT
Learn about all the available installation methods for PostgreSQL monitoring with New Relic.
Ansible install
Learn how to install and configure PostgreSQL monitoring at scale with the newrelic.newrelic_install Ansible role.
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.
Docker install
Learn how to run the NRDOT Collector as a sibling container to a PostgreSQL instance already running in Docker.