Merge "some points unable to parse"

This commit is contained in:
Zuul 2019-03-19 16:31:04 +00:00 committed by Gerrit Code Review
commit 4faa6172c1
3 changed files with 22 additions and 1 deletions

View File

@ -32,7 +32,11 @@ repositories_opts = [
name='events_driver',
help='The repository driver to use for events',
default=('monasca_persister.repositories.elasticsearch.events_repository:'
'ElasticSearchEventsRepository'))]
'ElasticSearchEventsRepository')),
cfg.BoolOpt(
'ignore_parse_point_error',
help='Specifies if InfluxDB parse point errors should be ignored and measurements dropped',
default=False)]
repositories_group = cfg.OptGroup(name='repositories',
title='repositories')

View File

@ -15,6 +15,7 @@
# limitations under the License.
import os
from oslo_config import cfg
from oslo_log import log
from monasca_common.kafka import consumer
@ -61,6 +62,13 @@ class Persister(object):
LOG.warning("Some points older than retention policy were dropped")
self._data_points = []
self._consumer.commit()
elif cfg.CONF.repositories.ignore_parse_point_error \
and "unable to parse points" in ex.message:
LOG.warning("Some points unable to parse were dropped")
self._data_points = []
self._consumer.commit()
else:
LOG.exception("Error writing to database: {}"
.format(self._data_points))

View File

@ -0,0 +1,9 @@
---
features:
- |
Configuration option `ignore_parse_point_error` added to allow dropping
malformed InfluxDB data points.
fixes:
- |
Fixed handling of InfluxDB parse point errors in case these were not
validated in the API.