PostgreSQL Enable Metrics
The PostgreSQL metrics collection feature enables monitoring of self-managed PostgreSQL deployments through the Kloudfuse collector. To collect metrics from your PostgreSQL instance, the collector requires specific configuration and database setup following Datadog’s PostgreSQL database monitoring guidelines, along with proper annotation of your PostgreSQL instance.
These settings are for the self-managed postgres deployments.
For the collector to scrape data from postgres, it requires a few things. Before continuing, complete the instructions in the Datadog documentation section on Setting Up Database Monitoring for self-hosted PostgreSQL.
-
The PostgreSQL instance must be annotated:
postgresql: primary: podAnnotations: ad.datadoghq.com/postgresql.check_names: '["postgres"]' ad.datadoghq.com/postgresql.init_configs: '[{}]' ad.datadoghq.com/postgresql.instances: '[{"host": "%%host%%", "port":5432, "username": "<user-you-created>", "password" : "<password-you-chose>", "tags" : []}]' readReplicas: podAnnotations: ad.datadoghq.com/postgresql.check_names: '["postgres"]' ad.datadoghq.com/postgresql.init_configs: '[{}]' ad.datadoghq.com/postgresql.instances: '[{"host": "%%host%%", "port":5432, "username": "<user-you-created>", "password" : "<password-you-chose>", "tags" : []}]'yaml -
After making the changes, restart PostgreSQL.