Supported telemetry types
The PostgreSQL integration supports these telemetry types:Prerequisites
The PostgreSQL integration has the following prerequisites:- Create a PostgreSQL role that can authenticate with a password and connect to the
postgresdatabase and every non-template database on each target. - Grant the monitoring role
SELECTaccess topg_stat_database. To collectANALYZEprogress for operations run by other roles, also grant the monitoring rolepg_monitor. This predefined role can read privileged server information, so grant it only when you need these progress metrics. - Make each PostgreSQL endpoint reachable from the collector.
Configure
To configure the PostgreSQL integration, follow these steps:- For discovered PostgreSQL targets, provide the endpoint and credentials through autodiscovery annotations. For more information, see autodiscovery.
-
Optional: Configure static targets, and provide the password through your
deployment’s secret management. For example, the following Helm values reference
the
POSTGRES_PASSWORDenvironment variable:
Validate
To validate the PostgreSQL integration, follow these steps:-
In Live Telemetry Analyzer, filter for
cxdot.integration.name=postgres. Confirm that the PostgreSQL metric names appear. -
In Metrics Explorer, run the following query while clients are connected to the
PostgreSQL servers:
Confirm that the query returns the expected time series for each target.
Configuration reference
Configure one PostgreSQL integration instance with the following settings. In Helm values, place these settings underconfig.integrations.postgres. In a Collector configuration file, place
them under cxdot.integrations.postgres.
Optional settings
-
enabledType:boolean. Optional. Default:true. Whether to enable this PostgreSQL integration instance. If true, the Collector collects PostgreSQL metrics. If false, the Collector doesn’t run this integration instance. -
usernameType:string. Optional. Default:postgres. PostgreSQL user for connections to every statically configured instance. -
passwordType:string. Optional. PostgreSQL password for connections to every statically configured instance. The Collector requires it to start collecting frominstancesentries, and masks the value in diagnostic output, logs, and errors. -
collection_intervalType:duration. Optional. Default:10s. How often the integration collects metrics from each PostgreSQL instance. -
timeoutType:duration. Optional. Default:10s. Maximum time allowed to collect metrics from a PostgreSQL instance during one interval. A value of0sdisables the timeout. -
instancesType:array of object. Optional. PostgreSQL instances to monitor. Eachendpointuseshost:portformat, such aspostgres.default.svc:5432. When this list contains an instance, the integration monitors only the listed instances and disables discovery through annotations for this integration instance. When the list is empty, the integration monitors targets supplied through PostgreSQL annotations. Each discovered target uses the credentials and TLS settings in its annotation. -
instances[].endpointType:string. Required. Network address of the PostgreSQL instance inhost:portformat. -
tlsType:object. Optional. Transport Layer Security (TLS) settings for connections to statically configured instances. By default, the integration uses TLS and verifies the server certificate. Setinsecure_skip_verifytotrueto use TLS without verifying the certificate. Setinsecuretotrueto connect without TLS. Targets discovered through annotations use the TLS settings in their annotations instead. -
tls.insecureType:boolean. Optional. In gRPC and HTTP when set to true, this is used to disable the client transport security. See https://godoc.org/google.golang.org/grpc#WithInsecure for gRPC. Please refer to https://godoc.org/crypto/tls#Config for more information. (optional, default false) -
tls.insecure_skip_verifyType:boolean. Optional. InsecureSkipVerify will enable TLS but not verify the certificate.

