diff --git a/aodh/evaluator/gnocchi.py b/aodh/evaluator/gnocchi.py index 2f8f2275a..524b6627f 100644 --- a/aodh/evaluator/gnocchi.py +++ b/aodh/evaluator/gnocchi.py @@ -70,10 +70,19 @@ class GnocchiResourceThresholdEvaluator(GnocchiBase): class GnocchiAggregationMetricsThresholdEvaluator(GnocchiBase): def _statistics(self, rule, start, end): try: + # FIXME(sileht): In case of a heat autoscaling stack decide to + # delete an instance, the gnocchi metrics associated to this + # instance will be no more updated and when the alarm will ask + # for the aggregation, gnocchi will raise a 'No overlap' + # exception. + # So temporary set 'needed_overlap' to 0 to disable the + # gnocchi checks about missing points. For more detail see: + # https://bugs.launchpad.net/gnocchi/+bug/1479429 return self._gnocchi_client.metric.aggregation( metrics=rule['metrics'], start=start, stop=end, - aggregation=rule['aggregation_method']) + aggregation=rule['aggregation_method'], + needed_overlap=0) except Exception as e: LOG.warning(_LW('alarm stats retrieval failed: %s'), e) return [] diff --git a/aodh/tests/unit/evaluator/test_gnocchi.py b/aodh/tests/unit/evaluator/test_gnocchi.py index 7f216f52b..6d00f4fa8 100644 --- a/aodh/tests/unit/evaluator/test_gnocchi.py +++ b/aodh/tests/unit/evaluator/test_gnocchi.py @@ -326,6 +326,7 @@ class TestGnocchiAggregationMetricsThresholdEvaluate(TestGnocchiEvaluatorBase): metrics=[ '0bb1604d-1193-4c0a-b4b8-74b170e35e83', '9ddc209f-42f8-41e1-b8f1-8804f59c4053'], + needed_overlap=0, start=start_alarm, stop=end)], self.client.metric.mock_calls) self._assert_all_alarms('alarm')