@@ -608,6 +608,8 @@ def get_placeholders(provider):
608608 #pgBackRest
609609 placeholders .setdefault ('USE_PGBACKREST' , False )
610610 placeholders .setdefault ('REPO_HOST' , False )
611+ # CPO-Monitoring
612+ placeholders .setdefault ('cpo_monitoring_stack' , False )
611613 # use namespaces to set WAL bucket prefix scope naming the folder namespace-clustername for non-default namespace.
612614 placeholders .setdefault ('WAL_BUCKET_SCOPE_PREFIX' , '{0}-' .format (placeholders ['NAMESPACE' ])
613615 if placeholders ['NAMESPACE' ] not in ('default' , '' ) else '' )
@@ -1198,6 +1200,18 @@ def main():
11981200 if 'extwlist.extensions' not in user_config .get ('postgresql' , {}).get ('parameters' , {}):
11991201 config ['postgresql' ]['parameters' ]['extwlist.extensions' ] = \
12001202 append_extensions (config ['postgresql' ]['parameters' ]['extwlist.extensions' ], version , True )
1203+ if placeholders ['cpo_monitoring_stack' ]:
1204+ current_libraries = config ['postgresql' ]['parameters' ].get ('shared_preload_libraries' , '' )
1205+
1206+ # Check if cpo_monitoring is enabled
1207+ if 'pgnodemx' not in current_libraries .split (',' ):
1208+ current_libraries = config ['postgresql' ]['parameters' ].get ('shared_preload_libraries' , '' )
1209+ if current_libraries and 'pgnodemx' not in current_libraries .split (',' ):
1210+ config ['postgresql' ]['parameters' ]['shared_preload_libraries' ] = current_libraries + ',' + 'pgnodemx'
1211+ else :
1212+ config ['postgresql' ]['parameters' ]['shared_preload_libraries' ] = 'pgnodemx'
1213+
1214+
12011215
12021216 # Ensure replication is available
12031217 if 'pg_hba' in config ['bootstrap' ] and not any (['replication' in i for i in config ['bootstrap' ]['pg_hba' ]]):
0 commit comments