Skip to content

Commit

Permalink
gnocchi: always set needed_overlap for aggregation
Browse files Browse the repository at this point in the history
gnocchi_aggregation_by_resources_threshold set needed_overlap
to workaround #1479429, we should do the same for
gnocchi_aggregation_by_metrics_threshold.

This change does it.

Related-bug: #1479429
Change-Id: I283200e23d69dbd174f990722711d6b538fe42e3
(cherry picked from commit cd7d7b2)
  • Loading branch information
sileht authored and jd committed Jul 13, 2016
1 parent 2c2b3f3 commit 5c98334
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion aodh/evaluator/gnocchi.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,19 @@ def _statistics(self, rule, start, end):
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:
LOG.exception(_('alarm stats retrieval failed'))
return []
Expand Down
1 change: 1 addition & 0 deletions aodh/tests/unit/evaluator/test_gnocchi.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def test_simple_alarm_trip(self, utcnow):
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')
Expand Down

0 comments on commit 5c98334

Please sign in to comment.