tools/reconcile-relay-rago compares relay_cost_events with Rago relay_llm_usage events for one UTC day, event by event: missing (dropped), dead-letter, amount mismatch, duplicate across orgs, orphan and overdue pending. Drift over 0.5%, any dead-letter or any duplicate pages the railyard ntfy topic; smaller findings are reported at default priority. ry_rago_drift_ratio and per-key and per-org figures go to VictoriaMetrics; a JSON report is kept per day. Both databases are read in READ ONLY transactions, so no charge of record changes. Includes systemd service and timer (04:20 UTC), installer, env sample, the emitter flip checklist per lane, and 12 offline tests (fake psql, local ntfy and VictoriaMetrics). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
922 B
Plaintext
18 lines
922 B
Plaintext
# /etc/products/reconcile-relay-rago.env (RY-RG1). No secrets: psql runs inside the
|
|
# shared Postgres container over its local socket, in READ ONLY transactions.
|
|
# Every line is optional; the values below are the defaults.
|
|
#RECON_PSQL=docker exec -i postgres-postgres-1 psql -U postgres
|
|
#RECON_RELAY_DB=relay
|
|
#RECON_RAGO_DB=rago
|
|
#RECON_METRIC_CODE=relay_llm_usage
|
|
# Page when drift is over this share of the day's Relay charges (0.005 = 0.5%).
|
|
#RECON_DRIFT_PAGE=0.005
|
|
# A row still undelivered after this many seconds counts as overdue.
|
|
#RECON_PENDING_GRACE_S=3600
|
|
# Set to 1 once RELAY_COST_FEED_URL is on (checklist step 3): overdue rows then
|
|
# count as drift and page. While 0, a feed that is off only shows in the report.
|
|
#RECON_EXPECT_FEED=0
|
|
#RECON_VM_IMPORT_URL=http://127.0.0.1:8428/api/v1/import/prometheus
|
|
#RECON_STATE_DIR=/var/lib/railyard/reconcile-relay-rago
|
|
#RECON_MONITORING_ENV=/etc/products/monitoring.env
|