Butler SOS can easily generate very large amounts of data, especially if data extract is done frequently (e.g. every 15 seconds) for large Sense environments.
This will result in a very large InfluxDB database.
Considering that Butler SOS is about operational metrics, it's usually not relevant to store more than a few weeks or months of data.
InfluxDB has a feature called "retention policies" that deal with exactly this scenario: they purge all data older than some threshold (e.g. older than 14 days or 6 weeks).
Retention policies can be manually applied to Butler SOS databases in Influxdb, that however requires using the command line influx client.
A more user friendly approach is to define one or more retention policies in the Butler SOS config file, and then automatically create those policies when re-creating the InfluxDB database.
The logic would look something like this:
- Butler SOS starts
- Does InfluxDB database exist?
2.a. If yes, continue starting Butler SOS
2.b. If no, create a new InfluxDB database, as well as any retention policies defined in the YAML config file. Then continue starting Butler SOS