Sign inSign up

repodb/telemetry-default-purger

By repodb

Updated 2 months ago

A background worker that periodically deletes expired rows from PGSQL telemetry table.

Image
Integration & delivery
Developer tools
Monitoring & observability
0

319

repodb/telemetry-default-purger repository overview

RepoDB Telemetry Purger Service

A background worker that periodically deletes expired rows from a RepoDB PGSQL telemetry table, based on StartTime column and defined retention period.

Running with Docker

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

Configuration

The rest of the service is configured via environment variables:

VariableRequiredDescription
CONNECTION_STRINGYesPostgreSQL connection string (e.g. postgresql://user:pass@host:5432/db).
RETENTION_PERIOD_IN_MINUTESNoRows older than this many minutes (relative to now) are deleted. Defaults to 10080 (7 days).
FREQUENCY_IN_MINUTESNoHow 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_LEVELNoLogging verbosity (DEBUG, INFO, WARNING, etc.). Defaults to DEBUG.

How It Works

On startup, a service runs an immediate purge cycle and then repeats indefinitely:

  1. Compute the cutoff timestamp: now - RETENTION_PERIOD_IN_MINUTES, floored down to the nearest FREQUENCY_IN_MINUTES boundary.
  2. Delete all rows from DefaultTelemetry table where StartTime field value is older than the cutoff.
  3. Log the number of rows deleted (or the exception, if the purge fails — failures are caught and logged so the service keeps running).
  4. Sleep before the next cycle.

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.

Tag summary

Content type

Image

Digest

sha256:fe40458e1

Size

49.2 MB

Last updated

2 months ago

docker pull repodb/telemetry-default-purger