Filtering by counter_volume is not working

Bug #1202569 reported by Alessandro Barabesi
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Opinion
Low
Jia Dong

Bug Description

counter_volume doesn't seem to be among the fields allowed in query filters.

Example:

GET http://10.10.10.10:8777/v2/meters/storage.objects.size

{
   "q": [{
    "field": "project_id",
    "op": "eq",
    "value": "77b461539c8542909f67b29939ec87dd"
   },
   {
    "field": "timestamp",
    "op": "ge",
    "value": "2013-07-16T13:00:00"
   },
   {
    "field": "timestamp",
    "op": "lt",
    "value": "2013-07-16T13:02:00"
   },
   {
    "field": "counter_volume",
    "op": "eq",
    "value": "1024"
   }]

  }

response:

{
 "error_message": "{\"debuginfo\": null, \"faultcode\": \"Client\", \"faultstring\": \"Unknown argument: \\\"counter_volume\\\": unrecognized query field\"}"
}

If other operators are used instead of "eq" there is no error message but the results are wrong

Example:

GET http://10.10.10.10:8777/v2/meters/storage.objects.size

{
   "q": [{
    "field": "project_id",
    "op": "eq",
    "value": "77b461539c8542909f67b29939ec87dd"
   },
   {
    "field": "timestamp",
    "op": "ge",
    "value": "2013-07-16T13:00:00"
   },
   {
    "field": "timestamp",
    "op": "lt",
    "value": "2013-07-16T13:02:00"
   },
   {
    "field": "counter_volume",
    "op": "gt",
    "value": "1024"
   }]

  }

response:

[{
 "counter_name": "storage.objects.size",
 "user_id": null,
 "resource_id": "77b461539c8542909f67b29939ec87dd",
 "timestamp": "2013-07-16T13:00:29",
 "resource_metadata": {

 },
 "source": "openstack",
 "counter_unit": "B",
 "counter_volume": 0.0,
 "project_id": "77b461539c8542909f67b29939ec87dd",
 "message_id": "b0e3606c-ee17-11e2-80d5-00259075703e",
 "counter_type": "gauge"
},
{
 "counter_name": "storage.objects.size",
 "user_id": null,
 "resource_id": "77b461539c8542909f67b29939ec87dd",
 "timestamp": "2013-07-16T13:01:29",
 "resource_metadata": {

 },
 "source": "openstack",
 "counter_unit": "B",
 "counter_volume": 0.0,
 "project_id": "77b461539c8542909f67b29939ec87dd",
 "message_id": "d49c4ef6-ee17-11e2-80d5-00259075703e",
 "counter_type": "gauge"
}]

xingzhou (xingzhou)
Changed in ceilometer:
assignee: nobody → xingzhou (xingzhou)
status: New → Confirmed
Julien Danjou (jdanjou)
Changed in ceilometer:
importance: Undecided → Low
Revision history for this message
gordon chung (chungg) wrote :

xingzhou, are you still looking at this? if you are, i think you should implement it similar to timestamp filter (as a range). it'll probably be more useful than searching for an exact volume.

if you aren't looking at it, i can take it over... i think.

Revision history for this message
xingzhou (xingzhou) wrote :

hi gordon, as work changed, I'm not looking at this any more, please take over it, thanks, sorry for the late response

Changed in ceilometer:
assignee: xingzhou (xingzhou) → nobody
Jia Dong (jiadong-jia)
Changed in ceilometer:
assignee: nobody → Jia Dong (jiadong-jia)
Revision history for this message
Jia Dong (jiadong-jia) wrote :

when i test in newest version, errors always occur whatever the "op" is gt or eq in "counter_volume". I think the "counter_volume" is not implemented.

Revision history for this message
Ildiko Vancsa (ildiko-vancsa) wrote :

Hi,

It is correct, the currently supported query fields are listed here: https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/__init__.py#L86

There is a blueprint about implementing complex queries, which supports counter_volume too: https://blueprints.launchpad.net/ceilometer/+spec/complex-filter-expressions-in-api-queries . Is this ok with you, if I link this bug to that blueprint?

Best Regards,
Ildiko

Revision history for this message
Jia Dong (jiadong-jia) wrote :

Hi Ildiko , that's ok, thank u.

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

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

Changed in ceilometer:
status: Confirmed → In Progress
Revision history for this message
gordon chung (chungg) wrote :

since we have complex query and are transitioning to v3 api... this might not be worth fixing anymore. i'll mark this 'wont fix' unless we have a reason we need this.

Changed in ceilometer:
status: In Progress → Opinion
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.