Create a Scheduled Script to Delete Metrics Older Than x Months
Created by: deepakduggirala
We currently accumulate a substantial amount of metrics data over time, which is consuming unnecessary storage resources. To maintain an efficient system and prevent data overload, we need to implement a scheduled script that automatically deletes metrics data older than x months.
Use a node scheduler library (node-cron) to periodically run a script to delete rows from metric table where timestamp is older than x months.
Number of months to retain the metrics has to be read from config.