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
This commit is contained in:
parent
47e5d1b4c6
commit
0ab568481f
@ -32,7 +32,11 @@ repositories_opts = [
|
|||||||
name='events_driver',
|
name='events_driver',
|
||||||
help='The repository driver to use for events',
|
help='The repository driver to use for events',
|
||||||
default=('monasca_persister.repositories.elasticsearch.events_repository:'
|
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',
|
repositories_group = cfg.OptGroup(name='repositories',
|
||||||
title='repositories')
|
title='repositories')
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from monasca_common.kafka import consumer
|
from monasca_common.kafka import consumer
|
||||||
@ -61,6 +62,13 @@ class Persister(object):
|
|||||||
LOG.warning("Some points older than retention policy were dropped")
|
LOG.warning("Some points older than retention policy were dropped")
|
||||||
self._data_points = []
|
self._data_points = []
|
||||||
self._consumer.commit()
|
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:
|
else:
|
||||||
LOG.exception("Error writing to database: {}"
|
LOG.exception("Error writing to database: {}"
|
||||||
.format(self._data_points))
|
.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…
Reference in New Issue
Block a user