3
0

add variable to prune.env

This commit is contained in:
12ww1160
2025-12-07 17:49:14 +01:00
parent 2cfa007c17
commit c44902c7c3
2 changed files with 4 additions and 1 deletions

View File

@@ -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

View File

@@ -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 %>