diff --git a/manifests/params.pp b/manifests/params.pp index d74da4d..a1785e7 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -40,6 +40,7 @@ # @param [Boolean] ps_dry_run (true = just log, false = actually delete blocks) # @param [String] ps_min_age_hours Minimum block age in hours before pruning # @param [String] ps_grace_hours Grace period in hours to be extra safe +# @param [String] ps_sql_template the SQL template to use for checks. ############################################################################## class prometheus_cd::params ( @@ -98,6 +99,7 @@ class prometheus_cd::params ( Boolean $ps_dry_run = true, String $ps_min_age_hours = '4', String $ps_grace_hours = '1', + String $ps_sql_template = 'Changeme', ) { # defaults diff --git a/templates/prune.env.erb b/templates/prune.env.erb index 0edc507..0f99edc 100644 --- a/templates/prune.env.erb +++ b/templates/prune.env.erb @@ -17,4 +17,5 @@ MIN_AGE_HOURS=<%= @ps_min_age_hours %> GRACE_HOURS=<%= @ps_grace_hours %> # SQL template to check if block exists in PostgreSQL -CHECK_SQL_TEMPLATE="SELECT 1 FROM metric_values WHERE metric_time >= to_timestamp({min}/1000.0) AND metric_time <= to_timestamp({max}/1000.0) LIMIT 1;" +# @param [String] ps_sql_template the SQL template to use for checks. +<%= @ps_sql_template %> \ No newline at end of file