Fixed the handling of metrics outside of the retention policy

Change-Id: I909c10eede6a0835ea02ca334914396dd1119801
Story: 2003202
Task: 23358
This commit is contained in:
Martin Chacon Piza 2018-08-01 13:03:51 +02:00
parent 26e6d294bc
commit 71b4d50f6e

View File

@ -57,8 +57,10 @@ class Persister(object):
self._data_points = []
self._consumer.commit()
except Exception as ex:
if ex.message.startswith("400: partial write: points beyond retention policy dropped"):
LOG.info("Some points older than retention policy were dropped")
if "partial write: points beyond retention policy dropped" in ex.message:
LOG.warning("Some points older than retention policy were dropped")
self._data_points = []
self._consumer.commit()
else:
LOG.exception("Error writing to database: {}"
.format(self._data_points))