Gnocchi's aggregation-by-metric alarm is not evaluated

Bug #1513738 reported by Yurii Prokulevych
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Aodh
Fix Released
High
Mehdi Abaakouk

Bug Description

Gnocchi's alarm of 'gnocchi_aggregation_by_metrics_threshold' type is not evaluated.
ceilometer alarm-show 553506ca-ac08-4d63-9dd2-0f5c1207d100
+---------------------------+------------------------------------------------------------+
| Property | Value |
+---------------------------+------------------------------------------------------------+
| aggregation_method | mean |
| alarm_actions | [u'log://'] |
| alarm_id | 553506ca-ac08-4d63-9dd2-0f5c1207d100 |
| comparison_operator | ge |
| description | Gnocchi Aggregation By Metrics Alarm |
| enabled | True |
| evaluation_periods | 3 |
| granularity | 60 |
| insufficient_data_actions | [u'log://'] |
| metrics | [u'e1e687d2-0ed1-4136-9476-7bb5ca145ea8', u'f5f1cd36-950e- |
| | 47f4-abc4-1ee193c6eefc'] |
| name | GnocchiAggregationByMetrics |
| ok_actions | [u'log://'] |
| project_id | |
| repeat_actions | False |
| severity | low |
| state | alarm |
| threshold | 3.0 |
| type | gnocchi_aggregation_by_metrics_threshold |
| user_id | |
+---------------------------+------------------------------------------------------------+

I've found that evaluator requests data from gnocchi with next body:

{'url': 'http://192.0.2.18:8041/v1/aggregation/metric', 'headers': {'Content-Type': 'application/json', 'X-Auth-Token': u'a8e1041a0ce
e47319f74b4ba03a38f9e'}, 'params': {'metric[]': [u'e1e687d2-0ed1-4136-9476-7bb5ca145ea8', u'f5f1cd36-950e-47f4-abc4-1ee193c6eefc'], 'start': '2015-11-06T07:26:48.086340', 'end': '2015-11-06T07:30:48.086340', 'ag
gregation': u'mean'}} _statistics /usr/lib/python2.7/site-packages/aodh/evaluator/gnocchi.py:89

And in gnocchi.log this body is than transformed to :
2015-11-06 07:27:03.506 26164 INFO werkzeug [-] 192.0.2.21 - - [06/Nov/2015 07:27:03] "GET /v1/aggregation/metric?metric%5B%5D=e1e687d2-0ed1-4136-9476-7bb5ca145ea8&start=2015-11-06T07%3A20%3A53.841397&end=2015-1
1-06T07%3A24%3A53.841397&aggregation=mean HTTP/1.1" 200 -

Running the query manually returned empty list:
curl -XGET -H 'X-Auth-Token: 3b775a05d2ab437b9f78f8506e752350' -H 'Content-Type: application/json' 'http://192.0.2.18:8041/v1/aggregation/metric?metric%5B%5D=e1e687d2-0ed1-4136-9476-7bb5ca145ea8&start=2015-11-06T07%3A20%3A53.841397&end=2015-11-06T07%3A24%3A53.841397&aggregation=mean'

After removing 'quoted' symbols "[", "]" from query I got result:
curl --silent -XGET -H 'X-Auth-Token: 3b775a05d2ab437b9f78f8506e752350' -H 'Content-Type: application/json' 'http://192.0.2.18:8041/v1/aggregation/metric?metric=e1e687d2-0ed1-4136-9476-7bb5ca145ea8&metric=f5f1cd36-950e-47f4-abc4-1ee193c6eefc&start=2015-11-06T07%3A39%3A53.841397&end=2015-11-06T07%3A40%3A53.841397&aggregation=mean' | python -m json.tool
[
    [
        "2015-11-06T07:40:00+00:00",
        300.0,
        21.5
    ],
    [
        "2015-11-06T07:40:00+00:00",
        60.0,
        20.0
    ],
    [
        "2015-11-06T07:41:00+00:00",
        60.0,
        21.0
    ],
    [
        "2015-11-06T07:42:00+00:00",
        60.0,
        22.0
    ],
    [
        "2015-11-06T07:43:00+00:00",
        60.0,
        23.0
    ]
]

Changing https://github.com/openstack/aodh/blob/master/aodh/evaluator/gnocchi.py#L75 to look like:
req['params']['metric'] = alarm.rule['metrics']

managed to get correct result by evaluator:
2015-11-06 07:45:20.826 6123 DEBUG aodh.evaluator.threshold [req-9b9bf3e3-db93-4ec2-9158-b528310ce5a0 - - - - -] comparing value 22.0 against threshold 3.0 _compare /usr/lib/python2.7/site-packages/aodh/evaluator/threshold.py:216
2015-11-06 07:45:20.827 6123 DEBUG aodh.evaluator.threshold [req-9b9bf3e3-db93-4ec2-9158-b528310ce5a0 - - - - -] comparing value 23.0 against threshold 3.0 _compare /usr/lib/python2.7/site-packages/aodh/evaluator/threshold.py:216
2015-11-06 07:45:20.828 6123 DEBUG aodh.evaluator.threshold [req-9b9bf3e3-db93-4ec2-9158-b528310ce5a0 - - - - -] comparing value 24.0 against threshold 3.0 _compare /usr/lib/python2.7/site-packages/aodh/evaluator/threshold.py:216

Packages:
=============AODH=============
openstack-aodh-compat-1.0.1-dev38.el7.centos.noarch
openstack-aodh-notifier-1.0.1-dev38.el7.centos.noarch
openstack-aodh-common-1.0.1-dev38.el7.centos.noarch
openstack-aodh-expirer-1.0.1-dev38.el7.centos.noarch
python-aodh-1.0.1-dev38.el7.centos.noarch
openstack-aodh-api-1.0.1-dev38.el7.centos.noarch
openstack-aodh-evaluator-1.0.1-dev38.el7.centos.noarch
openstack-aodh-listener-1.0.1-dev38.el7.centos.noarch
=============GNOCCHI=============
openstack-gnocchi-carbonara-1.2.1-dev37.el7.centos.noarch
openstack-gnocchi-metricd-1.2.1-dev37.el7.centos.noarch
openstack-gnocchi-common-1.2.1-dev37.el7.centos.noarch
openstack-gnocchi-api-1.2.1-dev37.el7.centos.noarch
python-gnocchi-1.2.1-dev37.el7.centos.noarch
openstack-gnocchi-indexer-sqlalchemy-1.2.1-dev37.el7.centos.noarch
openstack-gnocchi-statsd-1.2.1-dev37.el7.centos.noarch
openstack-gnocchi-doc-1.2.1-dev37.el7.centos.noarch

Regards,
Yurii

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to aodh (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/242386

Changed in aodh:
assignee: nobody → Mehdi Abaakouk (sileht)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to aodh (master)

Fix proposed to branch: master
Review: https://review.openstack.org/242387

Mehdi Abaakouk (sileht)
Changed in aodh:
importance: Undecided → High
tags: added: liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to aodh (master)

Reviewed: https://review.openstack.org/242386
Committed: https://git.openstack.org/cgit/openstack/aodh/commit/?id=ca6f4fbe26d671a042ee1a15164106ea0e5bfc97
Submitter: Jenkins
Branch: master

commit ca6f4fbe26d671a042ee1a15164106ea0e5bfc97
Author: Mehdi Abaakouk <email address hidden>
Date: Fri Nov 6 09:11:06 2015 +0100

    Move evaluator tests into the unit folder

    The evaluator tests are not run since we split functional and unit
    tests.

    This change moves them into unit folder to be ran again.

    Related bug: #1513738

    Change-Id: Iad5018756b521c041cb25d74f1d032de6a2bf2e1

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to aodh (master)

Reviewed: https://review.openstack.org/242387
Committed: https://git.openstack.org/cgit/openstack/aodh/commit/?id=bbb9e3c7b0ab5a8cb35e7d3cd264f3d94ea43fe8
Submitter: Jenkins
Branch: master

commit bbb9e3c7b0ab5a8cb35e7d3cd264f3d94ea43fe8
Author: Mehdi Abaakouk <email address hidden>
Date: Fri Nov 6 08:50:18 2015 +0100

    Fixing evaluation of gnocchi aggregation-by-metric

    A typo in metric parameters for requests

    Change-Id: I8bb81a645b69ee065dd8f88b9b996ab1d116f84d
    Closes-bug: #1513738

Changed in aodh:
status: In Progress → Fix Committed
Changed in aodh:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to aodh (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/275808

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to aodh (stable/liberty)

Reviewed: https://review.openstack.org/275808
Committed: https://git.openstack.org/cgit/openstack/aodh/commit/?id=837c6f6cd71c6a653121525cbe26c8dea9b17074
Submitter: Jenkins
Branch: stable/liberty

commit 837c6f6cd71c6a653121525cbe26c8dea9b17074
Author: Mehdi Abaakouk <email address hidden>
Date: Fri Nov 6 08:50:18 2015 +0100

    Fixing evaluation of gnocchi aggregation-by-metric

    A typo in metric parameters for requests

    Change-Id: I8bb81a645b69ee065dd8f88b9b996ab1d116f84d
    Closes-bug: #1513738
    (cherry picked from commit bbb9e3c7b0ab5a8cb35e7d3cd264f3d94ea43fe8)

tags: added: in-stable-liberty
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/ceilometer 5.0.3

This issue was fixed in the openstack/ceilometer 5.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to aodh (stable/liberty)

Related fix proposed to branch: stable/liberty
Review: https://review.openstack.org/344287

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to aodh (stable/liberty)

Reviewed: https://review.openstack.org/344287
Committed: https://git.openstack.org/cgit/openstack/aodh/commit/?id=d1fc9c474afb63f72c54c3460ac57009ca8e21b3
Submitter: Jenkins
Branch: stable/liberty

commit d1fc9c474afb63f72c54c3460ac57009ca8e21b3
Author: Mehdi Abaakouk <email address hidden>
Date: Fri Nov 6 09:11:06 2015 +0100

    Move evaluator tests into the unit folder

    The evaluator tests are not run since we split functional and unit
    tests.

    This change moves them into unit folder to be ran again.

    Related bug: #1513738

    Change-Id: Iad5018756b521c041cb25d74f1d032de6a2bf2e1
    (cherry picked from commit ca6f4fbe26d671a042ee1a15164106ea0e5bfc97)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.