• /
  • EnglishEspañolFrançais日本語한국어Português
  • Se connecterDémarrer

Configure PostgreSQL monitoring with OpenTelemetry Collector (CNCF)

|View as Markdown (English)

You can use the OpenTelemetry Collector Contrib for PostgreSQL to monitor your instance. The OpenTelemetry Collector Contrib is a community-supported project that collects telemetry data from PostgreSQL and sends it to New Relic.

By default, the OpenTelemetry Collector Contrib collects limited metrics from PostgreSQL. To send query performance, wait-event, session, and client metrics, you'll need to configure the OpenTelemetry Collector Contrib. This guide shows you how to configure it to collect advanced metrics from PostgreSQL and send them to New Relic.

Note

This page covers the community postgresql receiver shipped in the standard otelcol-contrib binary. If you're using New Relic's distribution (NRDOT), see Introduction to PostgreSQL monitoring instead.

Prerequisites

  • OpenTelemetry Collector Contrib (otelcol-contrib) installed and configured on your system. You can download the latest release from the OpenTelemetry Collector releases page.

  • pg_stat_statements enabled via shared_preload_libraries on the monitored PostgreSQL instance. This is required for query performance, wait-event, session, and client data. See Recommended server parameters.

  • The collector started in semantic-convention mode using the receiver.postgresql.useOTelSemconv feature gate.

    If you're running otelcol-contrib as an RPM/Debian package (systemd service), the service file imports environment variables via EnvironmentFile=/etc/otelcol-contrib/otelcol-contrib.conf. In that file, append the flag to OTELCOL_OPTIONS:

    bash
    $
    OTELCOL_OPTIONS="--config=/etc/otelcol-contrib/config.yaml --feature-gates=receiver.postgresql.useOTelSemconv"

    After saving the file, restart the service to apply the gate:

    bash
    $
    sudo systemctl restart otelcol-contrib

Enable UI metrics

You can enrich your New Relic platform experience by adding and enabling metrics in your otelcol-contrib configuration file. Using the configuration provided in this section, you can populate data for the following pages in the New Relic platform:

  • Overview

  • Query performance

  • Wait events

  • Sessions

  • Clients

Restart the OpenTelemetry Collector

Restart the OpenTelemetry Collector to apply the configuration changes:

bash
$
sudo systemctl restart otelcol-contrib

Introduction to PostgreSQL monitoring with NRDOT

Learn about all the available installation methods for PostgreSQL monitoring with New Relic.

Metrics reference

Learn about the available metrics collected by the NRDOT Collector.

Droits d'auteur © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.