<DIV>Thanks Julien :)</DIV>
<DIV> </DIV>
<DIV>> But I don't think Ceilometer has this metric posted to Gnocchi yet, the<BR>> code is a bit young and not finished on the Ceilometer side. If you<BR>> check gnocchi_resources.yaml, it's still marked "ignored" for now.</DIV>
<DIV> </DIV>
<DIV>I checked it again, no "ignored" is marked, seems the bug of devstack ;(</DIV>
<DIV> </DIV>
<DIV>And it's OK that gnocchi is not perfect now, but I still have some worries about how gnocchi deal with or going to deal with instance-xxxx-tapxxx condition.</DIV>
<DIV>I see 'network.incoming.bytes' belongs to resouce type 'instance'. But no attributes of instance can save the infomation of tap name. Although I can search</DIV>
<DIV>all metric ids from resouce id(instance uuid), how do I distinguish them from different taps of an instance?</DIV>
<DIV>
<DIV style="FONT-SIZE: 12px; FONT-FAMILY: Arial Narrow; COLOR: #909090">------------------</DIV>
<DIV style="FONT-SIZE: 14px; FONT-FAMILY: Verdana; COLOR: #000">Luo Gangyi
<DIV>
<DIV>luogangyi@cmss.chinamobile.com</DIV></DIV></DIV></DIV>
<DIV> </DIV>
<DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV style="FONT-SIZE: 12px; FONT-FAMILY: Arial Narrow; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px">------------------ 原始邮件 ------------------</DIV>
<DIV style="FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px">
<DIV><B>发件人:</B> "Julien Danjou";<julien@danjou.info>;</DIV>
<DIV><B>发送时间:</B> 2015年9月12日(星期六) 凌晨0:01</DIV>
<DIV><B>收件人:</B> "Luo Gangyi"<lgy181@foxmail.com>; <WBR></DIV>
<DIV><B>抄送:</B> "OpenStack Development Mailing L"<openstack-dev@lists.openstack.org>; <WBR></DIV>
<DIV><B>主题:</B> Re: [openstack-dev] [Ceilometer][Gnocchi] Gnocchi cannot deal with combined resource-id ?</DIV></DIV>
<DIV><BR></DIV>On Fri, Sep 11 2015, Luo Gangyi wrote:<BR><BR>Hi Gangyi,<BR><BR>> I am using master branch and newest code for testing.<BR><BR>Cool.<BR><BR>> For the purpose for learning the structure of gnocchi, I changed the<BR>> default UUID type of mysql from binary to char, so I can easily link<BR>> the resource-id(I mean in database), metric id and directory name of<BR>> storing measures.<BR><BR>Bah, don't do that – and rather use PostgreSQL, it's the recommended<BR>backend. :)<BR><BR>> When I did that, I found all the metrics where their resource id is<BR>> combined(here, I mean in Ceilometer, such as instance-xxx-tapxxxx)<BR>> have no measures stored.<BR><BR><BR>> Log in Ceilometer collector records this:<BR>> "<BR>> 2015-09-11 07:55:55.097 10636 ERROR ceilometer.dispatcher.gnocchi [-] Resource instance-00000001-4641f59e-994c-4255-b0ec-43a276d1c19c-tap8aadb7ad-d7 creation failed with status: 400: <html><BR>> <head><BR>> <title>400 Bad Request</title><BR>> </head><BR>> <body><BR>> <h1>400 Bad Request</h1><BR>> The server could not comply with the request since it is either malformed or otherwise incorrect.<br /><br /><BR>> Invalid input: required key not provided @ data['display_name']<BR>> </body><BR>> </html><BR>><BR>> "<BR>> So I wander whether gnocchi cannot deal with such combined resource-id metrics or whether it is because I change the UUID type or whatever.<BR><BR>Yes, it can, but the problem is more likely in the Ceilometer collector<BR>dispatcher code that is sending the data. From the error you have, it<BR>seems it tries to create an instance but it has no value for<BR>display_name, so it is denied by Gnocchi. If this is from a standard<BR>devstack installation, I'd suggest to open a bug on Ceilometer.<BR><BR>> And another question is how to query measures for those metrics whose<BR>> resource id is combined.<BR><BR>They are resource on their own so if you know their id you can just<BR>access the metrics at /v1/resources/<type>/<id>/metric/<name>/measures.<BR><BR>> For example, I want to query the network traffic of an vm, I know the<BR>> instance uuid 1111-2222, I know metric name<BR>> 'network.incoming.byte.rate' but I do not know the exact resouce_id<BR>> and metric id. What procedure should I do ?<BR><BR>You need to know the ID of the resource and then ask for its metric on<BR>the REST interface. If you don't know the ID of the resource, you can<BR>search for it by instance id.<BR><BR>But I don't think Ceilometer has this metric posted to Gnocchi yet, the<BR>code is a bit young and not finished on the Ceilometer side. If you<BR>check gnocchi_resources.yaml, it's still marked "ignored" for now.<BR><BR>-- <BR>Julien Danjou<BR>;; Free Software hacker<BR>;; http://julien.danjou.info<BR><BR>
<DIV></DIV></DIV>