tams-flow-manager — Retention
tams-flow-manager — Retention
Section titled “tams-flow-manager — Retention”Recording everything only works if old material ages out. The flow-manager is the daemon that keeps each flow to a rolling window — “last 60 minutes” — by asking the server to delete segments past their retention.
- Language: Rust · background daemon (no listening port).
How it works
Section titled “How it works”Every POLL_INTERVAL_SECONDS: list flows → apply include/exclude filters →
skip read-only flows → for each flow’s segments older than RETENTION_MINUTES,
POST /flow-delete-requests (bounded by MAX_DELETE_MINUTES_PER_CYCLE) →
monitor each request’s status (created → started → done / error).
Configuration (environment)
Section titled “Configuration (environment)”- Required:
TAMS_URL,TAMS_USERNAME/TAMS_PASSWORD,STORAGE_ID(used for deletion tracking). - Retention & polling:
RETENTION_MINUTES(60),POLL_INTERVAL_SECONDS(30),MAX_DELETE_MINUTES_PER_CYCLE(10). - Flow filtering (optional):
INCLUDE_FLOWS/EXCLUDE_FLOWS(comma-separated UUIDs),LOG_LEVEL.
Build & notes
Section titled “Build & notes”./phrame-make.sh <TAG> build-image (or cargo build --release). A
docker-compose.yml runs it on the shared tams-network. Modules: main.rs
(polling loop), config.rs (env parsing), manager.rs (trim-cycle logic),
client.rs (TAMS HTTP client). Stack: reqwest, tokio, serde, uuid,
tracing.
