If no data retention is set for a metric, which can also be via tenant creation, then the system-wide default is used. That default is the hard-coded value, MetricsServiceImpl.DEFAULT_TTL. This should be configurable during the initial start up when the schema is installed. This needs to be stored in the database so that the value can be accessed and read by all Hawkular servers. This begs the question of where in the database it should be stored. There will be other system wide default settings that we are going to need to store as well, so we need to take that into consideration.
I think it makes sense to have an internal, system tenant with which these settings are stored. As it turns out, I had introduced the concept of the system tenant and then subsequently removed it for
HWKMETRICS-240 because I did not think we would be needing it for the 0.7.0 release. Unless someone has alternative approach, I propose bringing back the system tenant in support of this.
Then we have to think about changing the retention settings after it has been set initially. I prefer to do that it a follow up ticket mostly to keep the amount of work per ticket smaller which hopefully makes reviewing PRs easier.