A background worker that periodically deletes expired extended telemetry from PGSQL telemetry table.
83
A background worker that periodically deletes expired rows from the ExtendedTelemetry table of RepoDB PGSQL, based on the StartTime column and a retention period. Only rows that the File Data Sinker has already archived are deleted.
Create the network (skip if it already exists):
docker network create repodb
Build the image:
docker build . -t repodb/telemetry-extended-purger:latest
Run the image:
docker run -d --name repodb-telemetry-extended-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-extended-purger:latest
The service is configured entirely 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 eligible for deletion. 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 the service runs an immediate purge cycle and then repeats indefinitely:
now - RETENTION_PERIOD_IN_MINUTES, floored down to the nearest FREQUENCY_IN_MINUTES boundary.ExtendedTelemetry where StartTime is older than the cutoff and ArchivedAt is set.Failures are caught and logged so the service keeps running. If the File Data Sinker is offline, expired rows stay in PostgreSQL instead of being deleted, so telemetry is kept over enforcing a strict database size. The archived files are never deleted by this service.
Content type
Image
Digest
sha256:99c171b76…
Size
49.4 MB
Last updated
16 days ago
docker pull repodb/telemetry-extended-purger