@@ -608,6 +608,8 @@ def get_placeholders(provider):
608
608
#pgBackRest
609
609
placeholders .setdefault ('USE_PGBACKREST' , False )
610
610
placeholders .setdefault ('REPO_HOST' , False )
611
+ # CPO-Monitoring
612
+ placeholders .setdefault ('cpo_monitoring_stack' , False )
611
613
# use namespaces to set WAL bucket prefix scope naming the folder namespace-clustername for non-default namespace.
612
614
placeholders .setdefault ('WAL_BUCKET_SCOPE_PREFIX' , '{0}-' .format (placeholders ['NAMESPACE' ])
613
615
if placeholders ['NAMESPACE' ] not in ('default' , '' ) else '' )
@@ -1198,6 +1200,18 @@ def main():
1198
1200
if 'extwlist.extensions' not in user_config .get ('postgresql' , {}).get ('parameters' , {}):
1199
1201
config ['postgresql' ]['parameters' ]['extwlist.extensions' ] = \
1200
1202
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
+
1201
1215
1202
1216
# Ensure replication is available
1203
1217
if 'pg_hba' in config ['bootstrap' ] and not any (['replication' in i for i in config ['bootstrap' ]['pg_hba' ]]):
0 commit comments