A background worker that periodically deletes expired rows from PGSQL telemetry table.
319
A background worker that periodically deletes expired rows from a RepoDB PGSQL telemetry table, based on StartTime column and defined retention period.
Create the network (skip if it already exists):
docker network create repodb
Run the image:
docker run -d --name repodb-telemetry-default-purger --cpus=0.25 \
-e CONNECTION_STRING="postgresql://postgres:RepoDB2026@repodb-insights-postgres:5432/repodb_insights" \
-e RETENTION_PERIOD_IN_MINUTES=10080 \
-e FREQUENCY_IN_MINUTES=5 \
--network=repodb \
repodb/telemetry-default-purger:latest
The rest of the service is configured via environment variables:
| Variable | Required | Description |
|---|---|---|
CONNECTION_STRING | Yes | PostgreSQL connection string (e.g. postgresql://user:pass@host:5432/db). |
RETENTION_PERIOD_IN_MINUTES | No | Rows older than this many minutes (relative to now) are deleted. Defaults to 10080 (7 days). |
FREQUENCY_IN_MINUTES | No | How often the purge runs, in minutes. Also used to align run times to a fixed grid (e.g. every 5 minutes on the clock). Defaults to 5. |
LOG_LEVEL | No | Logging verbosity (DEBUG, INFO, WARNING, etc.). Defaults to DEBUG. |
On startup, a service runs an immediate purge cycle and then repeats indefinitely:
now - RETENTION_PERIOD_IN_MINUTES, floored down to the nearest FREQUENCY_IN_MINUTES boundary.DefaultTelemetry table where StartTime field value is older than the cutoff.Note: the sleep interval is measured from the timestamp captured when the service started, not from the previous cycle's run time. In practice this means the gap between successive purges grows over time rather than staying fixed at FREQUENCY_IN_MINUTES; it does not reset itself between cycles.
Content type
Image
Digest
sha256:fe40458e1…
Size
49.2 MB
Last updated
2 months ago
docker pull repodb/telemetry-default-purger