some points unable to parse
some metrics get from kafka,may not a standard point that influxdb can parse.in this case,points should be dropped. Task: 29641 Story: 2005069 Change-Id: Ib907a280ced26ef2c228efe14b57440f894d8aad (cherry picked from commit 0ab568481f893b5be5c3cb1652f0c53cf5f378e9)
This commit is contained in:
parent
75eb9808b6
commit
4c5b38a282
@ -31,7 +31,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')
|
||||
|
@ -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))
|
||||
|
@ -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.
|
Loading…
x
Reference in New Issue
Block a user