This article will discuss how to purge the analytics data from the Druid database in order to save disk space, as it can often lead to excessive disk space usage causing various concerns in the API Portal.
The disk space for the /var/lib/docker/overlay partition on the Docker portal has grown close to 100%. A review of the biggest files in this partition, by using the following command, shows the Druid database taking most of the space. This is caused by storing too much data in Analytics.
du -a /var/lib/docker/overlay | sort -n -r | head -n 20
This affects all API Developer Portal versions with Druid as the Analytics engine.
The Portal analytics data is stored for 731 days by default. You can change this setting by running the following commands. Please note if you change the days then the data after those many days will be removed.
This will keep the 100 days worth of analytics data in the Druid database. You can use any number for the days as it fits your use case.
***The data will be permanently deleted after setting the new value***
Please make sure to try these steps in the non-production server first to observe the results before trying it in the live production server.