3
0

OP#188 add env file

This commit is contained in:
2025-12-04 13:11:43 +01:00
parent 11eeeb4c2b
commit 7f1e0daded
4 changed files with 63 additions and 0 deletions

20
templates/prune.env.erb Normal file
View File

@@ -0,0 +1,20 @@
# /opt/prometheus-prune/prune.env
# PostgreSQL connection
PGHOST=<%= @ps_pg_host %>
PGPORT=<%= @ps_pg_port %>
PGDATABASE=<%= @ps_pg_db %>
PGUSER=<%= @ps_pg_user %>
PGPASSWORD=<%= @ps_pg_pass %>
# Dry-run mode (true = just log, false = actually delete)
DRY_RUN=<%= @ps_dry_run %>
# Minimum block age in hours before pruning
MIN_AGE_HOURS=<%= @ps_min_age_hours %>
# Grace period in hours to be extra safe
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;"