PostgreSQLParameters provides additional required configuration parameters that Postgres needs to support monitoring for both pgMonitor and OTel
(ctx context.Context, inCluster *v1beta1.PostgresCluster, outParameters *postgres.Parameters)
| 37 | // PostgreSQLParameters provides additional required configuration parameters |
| 38 | // that Postgres needs to support monitoring for both pgMonitor and OTel |
| 39 | func PostgreSQLParameters(ctx context.Context, inCluster *v1beta1.PostgresCluster, outParameters *postgres.Parameters) { |
| 40 | if ExporterEnabled(ctx, inCluster) || |
| 41 | collector.OpenTelemetryMetricsEnabled(ctx, inCluster) { |
| 42 | |
| 43 | // Exporter expects that shared_preload_libraries are installed |
| 44 | // pg_stat_statements: https://access.crunchydata.com/documentation/pgmonitor/latest/exporter/ |
| 45 | // pgnodemx: https://github.com/CrunchyData/pgnodemx |
| 46 | outParameters.Mandatory.AppendToList("shared_preload_libraries", "pg_stat_statements", "pgnodemx") |
| 47 | outParameters.Mandatory.Add("pgnodemx.kdapi_path", |
| 48 | postgres.DownwardAPIVolumeMount().MountPath) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | // DisableMonitoringUserInPostgres disables the exporter configuration in PostgreSQL. |
| 53 | // Currently the exporter is disabled by removing login permissions for the |