Skip to content

Commit c4c4340

Browse files
Add backwards compatibility for data_dir_functions
1 parent 868124a commit c4c4340

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

postgresql_metrics/metrics_logic.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ def get_stats_functions_from_conf(func_key_name, conf):
123123
def get_all_stats_functions_from_conf(conf):
124124
db_functions = get_stats_functions_from_conf('db_functions', conf)
125125
global_db_functions = get_stats_functions_from_conf('global_db_functions', conf)
126-
return db_functions, global_db_functions
126+
# `data_dir_functions` is deprecated, but to preserve backwards compatibility still read
127+
data_dir_functions = get_stats_functions_from_conf('data_dir_functions', conf)
128+
if data_dir_functions:
129+
LOG.warn("data_dir_functions field in config is deprecated -- consider moving functions to global_db_functions")
130+
all_global_db_functions = data_dir_functions + global_db_functions
131+
return db_functions, all_global_db_functions
127132

128133

129134
def get_all_metrics_now(db_connections, conf):

0 commit comments

Comments
 (0)