π Retention Settings for HM-Only Data Storage
π― Objective
The customer requires only Hardware Metrics (HM) data to be retained. All other data types β such as functions, raw data, screenshots, and KPIs β must be automatically removed based on defined retention settings.
βοΈ Related Retention Parameters and Their Effects
Parameter | Description |
---|---|
πΌοΈ | Defines how long screenshots are stored (e.g. |
π¦ | Specifies how many days Functions Item data is retained. |
π¦ | Controls how long Item Data is stored. |
π¦ | Indicates retention period for unprocessed raw data. |
π | Duration for storing Hardware Metrics (Prometheus/VictoriaMetrics). |
β οΈ Warnings:
Setting any of the above to 0 causes immediate deletion of respective data.
Negative values should only be used for deleting KPI aggregates (WEEKLY, MONTHLY).
DO NOT set RETENTION_FUNCTIONS_ITEM_DAYS, RETENTION_ITEM_DATA_DAYS, or RETENTION_RAW_DATA_DAYS to negative values β it will cause errors.
πInfo:
All the retention parameters are described in the Special settings article
π οΈ Recommended Configuration
Frequent Cleanup via Cron
β±οΈ Set up a cron job to remove non-HM data every 10 minutes.
π Ensures quick turnover and aligns with the requirement to retain HM only.
π Pipelines to be cleaned up
kpi-pipeline
rawdata-pipeline
process-pipeline
π Behaviour Validation
β HM data is retained and displayed properly on frontend.
β Screenshots are not stored (
SCREENSHOTS_RETENTION_DAYS = 0
).β»οΈ Functions and raw data are cleared every 10 minutes.
π§Ή KPI data (HOURLY + DAILY) is removed daily via cron.
β Final Configuration Summary
The final configuration ensures that only essential Hardware Metrics (HM) data is retained, while all non-HM data (functions, raw data, screenshots, and KPI aggregates) is regularly cleaned up using retention settings and scheduled cron jobs. This approach:
β Meets the customerβs requirement to retain HM only
π§Ή Minimizes data storage and system load by removing unnecessary data quickly
π οΈ Prevents errors by using valid retention values (
0
instead of negative) for non-aggregate dataπ Keeps the system clean and efficient with a 10-minute cleanup cycle
Overall, it balances system performance with compliance to data retention policies.
Parameter | Value | Notes |
---|---|---|
πΌοΈ |
| No screenshots stored |
π¦ |
| Cleared every 10 mins via cron |
π¦ |
| Cleared every 10 mins via cron |
π¦ |
| Cleared every 10 mins via cron |
ποΈ HM Retention |
| β Retained and displayed correctly |
FAQ
What is a βCronβ job?
A cron job is a scheduled task that runs automatically at specified intervals on Unix-like operating systems (such as Linux). It uses a service called cron to execute commands, scripts, or programs at fixed times, dates, or intervals.
What if I leave a retention parameter empty?
If a parameter is left empty or not set, the data will be retained indefinitely by default. Each parameter also has a system-defined default (e.g., 14
or 31
days).
Is HM data ever deleted automatically?
Only if RETENTION_HARDWARE_METRICS_DATA_DAYS
is set to 0
or another finite number.
Default is 31
days. If set to empty, HM data is retained indefinitely.