Ask Your Question
0

How to change gnocchi archive-policy for a metric

asked 2018-02-14 11:27:46 -0600

AndyW gravatar image

Hi, greetings (telemetry) experts, (battling with this change to aodh/gnocchi!)

Am running RDO Packstack (Pike) all-in-1 on CentOS7 and have aodh and gnocchi enabled.

Am trying to create an aodh alarm for excessive CPU use, but alarm is showing 'insufficient data'

aodh alarm create --type gnocchi_resources_threshold --name cpu_hi --description 'cpu running hot' --metric cpu_util --threshold 70 --comparison-operator gt --aggregation-method mean --granularity 120 --evaluation-periods 1 --resource-type instance --alarm-action 'log://' --resource-id $ServerUUID

gnocchi measurements seem to be accumulating as can query my resource (serverUUID) for cpu_util

$ gnocchi measures show cpu_util --resource-id ef71a9c5-1f13-409f-9515-3a955b1637ca

+---------------------------+-------------+---------------+

| timestamp | granularity | value |

+---------------------------+-------------+---------------+

| 2018-02-14T15:40:00+01:00 | 300.0 | 6.0545565637 |

| 2018-02-14T15:45:00+01:00 | 300.0 | 54.0420935459 |

| 2018-02-14T15:50:00+01:00 | 300.0 | 57.8902041207 |

| 2018-02-14T15:55:00+01:00 | 300.0 | 6.2597518298 |

| 2018-02-14T16:00:00+01:00 | 300.0 | 5.8051771301 |

| 2018-02-14T16:05:00+01:00 | 300.0 | 72.7606542992 |

| 2018-02-14T16:10:00+01:00 | 300.0 | 96.3522174786 |

| 2018-02-14T16:15:00+01:00 | 300.0 | 96.4160094293 |

| 2018-02-14T16:20:00+01:00 | 300.0 | 96.5402082843 |

| 2018-02-14T16:25:00+01:00 | 300.0 | 96.4775903627 |

| 2018-02-14T16:30:00+01:00 | 300.0 | 96.4278695426 |

| 2018-02-14T16:35:00+01:00 | 300.0 | 96.6071384618 ...............

these measurements correspond to a default archive-policy of LOW (5min intervals). (yes, am stressing CPU to try and trigger aodh alarm (for a quick demo) , its fairly obvious my alarm granularity is too low at 120 secs - so, wrong archive_policy ?

Is there any way to change the archive_policy for this one particular metric to Medium for example (or do I have to change to Medium policy for ALL metrics)? If I run gnocchi metric list I see all 1004 metrics currently use LOW. In case I can't change a single metric's policy, How does one change the general archive policy ? (note: running all-in-1 in a 30GB VM so haven't got loads of storage)

thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-02-16 20:52:21 -0600

Gnocchi, by default has 3 archive policy high(granularity of 1 second), medium (granularity of 1 second) and low(granularity of 1 second) https://gnocchi.xyz/operating.html#default-archive-policies ([Archive-policy]). For use a granularity 120, you need to create a new archive policy. The archive policy is changed to all metrics. To change the archive policy you need to change /etc/ceilometer/ceilometer.conf

[dispatcher_gnocchi] archive_policy = medium

And change the interval in /etc/ceilometer/polling.yaml

interval: 60

After that just restart all services of the gnocchi and ceilometer.

edit flag offensive delete link more

Comments

thanks To check alarm was working at all I changed --granularity to 600 to comply with a "low" policy but still alarm showed insufficient data (similar aodh command line to above) , any idea why it might not be triggered?

AndyW gravatar imageAndyW ( 2018-02-22 11:22:14 -0600 )edit

Create an alarm with a low threshold, for example --threshold 10. After waiting the 5 minutes for granularity, check that the alarm has changed to OK or Alarm. If it does not work check the AODH log. It worked for me.

pablobrunetti gravatar imagepablobrunetti ( 2018-02-26 12:44:00 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-02-14 11:27:46 -0600

Seen: 602 times

Last updated: Feb 16