MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / PostgreSQLParameters

Function PostgreSQLParameters

internal/pgmonitor/postgres.go:39–50  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

37// PostgreSQLParameters provides additional required configuration parameters
38// that Postgres needs to support monitoring for both pgMonitor and OTel
39func 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

Callers 2

TestPostgreSQLParametersFunction · 0.70

Calls 5

DownwardAPIVolumeMountFunction · 0.92
ExporterEnabledFunction · 0.85
AppendToListMethod · 0.80
AddMethod · 0.45

Tested by 1

TestPostgreSQLParametersFunction · 0.56