[openstack-dev] [ceilometer] resource_metadata and metaquery

Lu, Lianhao lianhao.lu at intel.com
Wed Jan 23 05:15:51 UTC 2013


Hi guys,

If my understanding is correct, the current resource_metadata stored by the ceilometer collector could be any python object which can be serialized to the JSON format, so the resource_metadata could be a dict containing values of dict/list/string, e.g. 

  {"key1": [ 
          { "key11": 11},
          { "key12": 12}
         ],
   "key2": "v2"
   "key3": {
        "key31": 31
       }
  }

Does the metaquery support complex conditions, like the form of metadata["key3"]["key31"] > 30 or { "key11": 11} in metadata["key1"], besides the simple form of metadata["key2"]=="v2"? 

Besides, supporting the metaquery in sqlalchemy is not easy as that in mongodb. The question is where should the query filter operation happen? We may do the metadata query filter operation on the sqlalchemy client side in python, which is comparably easy to implement and easy to be adapted to complex filter conditions, but is bad in performance because it needs to get all the records from backend DB to do that. 

The other way is to do the metadata query filter operation on the backend DB side which should have better performance, but I don't know how to do that to support complex conditions other than the simple form of metadata["key2"]=="v2".

Any comment?

Best Regards,
-Lianhao



More information about the OpenStack-dev mailing list