Failed to create alarm-gnocchi-aggregation-by-resources-threshold-create on existing resources

Bug #1550416 reported by Yurii Prokulevych
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Invalid
Undecided
Unassigned

Bug Description

When trying to create alarm-gnocchi-aggregation-by-resources-threshold-create on already existing resources it might fail with message:
    """Metrics 051d6048-c2ea-40e8-bdb9-d0880f3be9e4 ,c6221906-1ba6-434a-836b-373aebea7727 can't be aggregated: No overlap """

ceilometer --debug alarm-gnocchi-aggregation-by-resources-threshold-create --name 'GnocchiAggregateByResourceThreshold' --description 'Gnocchi Alarm that a
ggregates one metric accros several resources' --severity 'low' --ok-action 'log://' --insufficient-data-action 'log://' --alarm-action 'log://' --granularity 60 --evaluation-periods 3 --aggregation-metho
d 'mean' --comparison-operator 'ge' --threshold 3.0 --metric 'MyMeterCumulative' --resource-type 'generic' --query '{"or":[{"=":{"id":"AlarmResource1"}},{"=":{"id":"AlarmResource2"}}]}'
DEBUG (session) REQ: curl -g -i -X GET http://192.0.2.6:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
INFO (connectionpool) Starting new HTTP connection (1): 192.0.2.6
DEBUG (connectionpool) "GET /v2.0 HTTP/1.1" 200 335
DEBUG (session) RESP: [200] date: Fri, 26 Feb 2016 16:41:29 GMT vary: X-Auth-Token content-length: 335 content-type: application/json x-openstack-request-id: req-39dca884-7870-4a82-9af6-917f294a470c
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"hre
f": "http://192.0.2.6:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2) Making authentication request to http://192.0.2.6:5000/v2.0/tokens
DEBUG (connectionpool) "POST /v2.0/tokens HTTP/1.1" 200 4243
DEBUG (session) REQ: curl -g -i -X GET http://192.0.2.6:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
INFO (connectionpool) Starting new HTTP connection (1): 192.0.2.6
DEBUG (connectionpool) "GET /v2.0 HTTP/1.1" 200 335
DEBUG (session) RESP: [200] date: Fri, 26 Feb 2016 16:41:29 GMT vary: X-Auth-Token content-length: 335 content-type: application/json x-openstack-request-id: req-745b5a0a-03e2-4d55-9a83-9b15884e07a8
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"hre
f": "http://192.0.2.6:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2) Making authentication request to http://192.0.2.6:5000/v2.0/tokens
DEBUG (connectionpool) "POST /v2.0/tokens HTTP/1.1" 200 4243
DEBUG (client) REQ: curl -g -i -X 'POST' 'http://192.0.2.6:8777/v2/alarms' -H 'User-Agent: ceilometerclient.openstack.common.apiclient' -H 'Content-Type: application/json' -H 'X-Auth-Token: {SHA1}b929e561ef434bc
d26e45a5d2e1a687ca0b5d0b6'
DEBUG (client) REQ BODY: {"alarm_actions": ["log://"], "user_id": "", "severity": "low", "name": "GnocchiAggregateByResourceThreshold", "gnocchi_aggregation_by_resources_threshold_rule": {"evaluation_periods": 3
, "metric": "MyMeterCumulative", "aggregation_method": "mean", "granularity": 60, "threshold": 3.0, "query": "{\"or\":[{\"=\":{\"id\":\"AlarmResource1\"}},{\"=\":{\"id\":\"AlarmResource2\"}}]}", "comparison_oper
ator": "ge", "resource_type": "generic"}, "insufficient_data_actions": ["log://"], "repeat_actions": false, "ok_actions": ["log://"], "project_id": "", "type": "gnocchi_aggregation_by_resources_threshold", "desc
ription": "Gnocchi Alarm that aggregates one metric accros several resources"}

INFO (connectionpool) Starting new HTTP connection (1): 192.0.2.6
DEBUG (connectionpool) "POST /v2/alarms HTTP/1.1" 400 499
DEBUG (client) RESP: [400] {'date': 'Fri, 26 Feb 2016 16:41:30 GMT', 'content-length': '499', 'content-type': 'application/json', 'x-openstack-request-id': 'req-3e56a629-3346-4bb0-8b97-89085d6fbb33', 'server': '
Werkzeug/0.9.1 Python/2.7.5'}

DEBUG (client) RESP BODY: {"error_message": {"debuginfo": null, "faultcode": "Client", "faultstring": "<html>\n <head>\n <title>400 Bad Request</title>\n </head>\n <body>\n <h1>400 Bad Request</h1>\n The serv
er could not comply with the request since it is either malformed or otherwise incorrect.<br /><br />\nOne of the metrics being aggregated doesn't have matching granularity: Metrics 051d6048-c2ea-40e8-bdb9-d0880
f3be9e4 ,c6221906-1ba6-434a-836b-373aebea7727 can't be aggregated: No overlap\n\n\n </body>\n</html>"}}

DEBUG (client) Request returned failure status: 400
Traceback (most recent call last):
  File "/usr/bin/ceilometer", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/ceilometerclient/shell.py", line 293, in main
    CeilometerShell().main(args)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/shell.py", line 242, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 495, in _wrapped
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 522, in _wrapped
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 560, in _wrapped
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/shell.py", line 669, in do_alarm_gnocchi_aggregation_by_resources_threshold_create
    alarm = cc.alarms.create(**fields)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/v2/alarms.py", line 161, in create
    return self._create(self._path(), new)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/common/base.py", line 63, in _create
    body = self.api.post(url, json=body).json()
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 358, in post
    return self.client_request("POST", url, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 345, in client_request
    self, method, url, **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 261, in client_request
    method, self.concat_url(endpoint, url), **kwargs)
  File "/usr/lib/python2.7/site-packages/ceilometerclient/openstack/common/apiclient/client.py", line 201, in request
    raise exceptions.from_response(resp, method, url)
ceilometerclient.openstack.common.apiclient.exceptions.BadRequest: <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  The server could not comply with the request since it is either malformed or otherwise incorrect.<br /><br />
One of the metrics being aggregated doesn't have matching granularity: Metrics 051d6048-c2ea-40e8-bdb9-d0880f3be9e4 ,c6221906-1ba6-434a-836b-373aebea7727 can't be aggregated: No overlap

 </body>
</html> (HTTP 400) (Request-ID: req-3e56a629-3346-4bb0-8b97-89085d6fbb33)

Packages:
ceilometer*-5.0.2-2.el7ost.noarch
gnocchi*-1.3.4-1.el7ost.noarch

---
Yurii

Revision history for this message
liyuanzhen (liyuanzhen) wrote :
Download full text (7.3 KiB)

Using the cmd in my env, there is no errors in creaating alarm-gnocchi-aggregation-by-resources-threshold-create.

the result is as following:

stack@devstack:~$ ceilometer --debug alarm-gnocchi-aggregation-by-resources-threshold-create --name 'GnocchiAggregateByResourceThreshold001' --description 'Gnocchi Alarm that a ggregates one metric accros several resources' --granularity 60 --evaluation-periods 3 --aggregation-method 'mean' --comparison-operator 'ge' --threshold 3.0 --metric 'cpu-01' --resource-type 'generic' --query '{"=":{"id":"a75321a9-6b15-4dfe-b29a-02d3b3008bfd"}}'
DEBUG (session) REQ: curl -g -i -X GET http://192.168.122.180:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
INFO (connectionpool) Starting new HTTP connection (1): 192.168.122.180
DEBUG (connectionpool) "GET /v2.0 HTTP/1.1" 200 345
DEBUG (session) RESP: [200] Date: Mon, 06 Jun 2016 09:33:14 GMT Server: Apache/2.4.7 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-6e6d6200-4f17-41dc-aac9-9d16c94afe8a Content-Length: 345 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/json
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://192.168.122.180/identity/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2) Making authentication request to http://192.168.122.180/identity/v2.0/tokens
INFO (connectionpool) Starting new HTTP connection (1): 192.168.122.180
DEBUG (connectionpool) "POST /identity/v2.0/tokens HTTP/1.1" 200 3830
DEBUG (client) REQ: curl -g -i -X 'GET' 'http://192.168.122.180:8042/' -H 'User-Agent: ceilometerclient.openstack.common.apiclient' -H 'X-Auth-Token: {SHA1}9c2fdd9b3b4aac15d4b416055462e89982600e00'
INFO (connectionpool) Starting new HTTP connection (1): 192.168.122.180
DEBUG (connectionpool) "GET / HTTP/1.1" 200 433
DEBUG (client) RESP: [200] {'Content-Length': '433', 'Keep-Alive': 'timeout=5, max=100', 'Server': 'Apache/2.4.7 (Ubuntu)', 'Connection': 'Keep-Alive', 'Date': 'Mon, 06 Jun 2016 09:33:14 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'x-openstack-request-id': 'req-1bdc97c9-75e5-41ee-8371-5f08899ff700'}

DEBUG (client) RESP BODY: {"versions": {"values": [{"status": "stable", "updated": "2013-02-13T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.telemetry-v2+json"}, {"base": "application/xml", "type": "application/vnd.openstack.telemetry-v2+xml"}], "id": "v2", "links": [{"href": "http://192.168.122.180:8042/v2", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}]}}

DEBUG (client) REQ: curl -g -i -X 'POST' 'http://192.168.122.180:8042/v2/alarms' -H 'User-Agent: ceilometerclient.openstack.common.apiclient' -H 'Content-Type: application/json' -H 'X-Auth-Token: {SHA1}9c2fdd9b3b4aac15d4b416055462e89982600e00'
DEBUG (client) REQ BODY: {"gnocchi_aggregation_by_resources_threshold_rule": {"evaluation_periods": 3, "metric": "cpu-01", "aggregation_meth...

Read more...

shruti (shruti)
Changed in ceilometer:
status: New → In Progress
assignee: nobody → shruti (shruti)
status: In Progress → New
assignee: shruti (shruti) → nobody
Revision history for this message
gordon chung (chungg) wrote :

this does seem to work. can you verify this with aodhclient?

Changed in ceilometer:
status: New → Incomplete
Revision history for this message
gordon chung (chungg) wrote :

closing. please reopen if there are more details

Changed in ceilometer:
status: Incomplete → Invalid
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.