That's what we do for existing openstack resources that have a UUID associated with them. Julien's question was, I think, about other sorts of resources that might be metered with ceilometer. We've had questions, for example, about using ceilometer to track PaaS resources.<div>
<br></div><div>Doug<br><br><div class="gmail_quote">On Fri, Nov 16, 2012 at 7:02 PM, Bhandaru, Malini K <span dir="ltr"><<a href="mailto:malini.k.bhandaru@intel.com" target="_blank">malini.k.bhandaru@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Cleanest way seems to use uuid for resource-id.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Doug Hellmann [mailto:<a href="mailto:doug.hellmann@dreamhost.com" target="_blank">doug.hellmann@dreamhost.com</a>]
<br>
<b>Sent:</b> Friday, November 16, 2012 3:11 PM<br>
<b>To:</b> <a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>; Doug Hellmann<br>
<b>Subject:</b> Re: [openstack-dev] [ceilometer] Possible issue with MongoDB storage resource ID<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Nov 16, 2012 at 8:57 AM, Julien Danjou <<a href="mailto:julien@danjou.info" target="_blank">julien@danjou.info</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">Hi,<br>
<br>
I was working on fixing a bug in the API, and wrote a test that<br>
unexpectedly failed.<br>
<br>
Digging, I've discovered that it's currently a problem on how the<br>
MongoDB storage handles its `resource' collection: you can't have 2<br>
resource with the same id even if they came from 2 different sources.<br>
Meaning that if you record:<br>
<br>
  Counter(source='abc', resource_id='foobar')<br>
  Counter(source='def', resource_id='foobar')<br>
<br>
You'll end up with the 'source' field being overwritte because the<br>
resource collection use resource_id as its MongoDB _id field.<br>
<br>
So in the end, the request '/sources/abc/resources/foobar' returns<br>
nothing.<br>
<br>
This seems like a bug to me, because I easily imagine external systems<br>
with different source values having resource-id that can collide,<br>
because they're not UUID or the like.<br>
<br>
Doug, what's your opinion this, and how to fix it?<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm not sure we can tell, from the inside of ceilometer, what a unique identifier for a resource described by a given meter event should be. I think the intent was that the sender would do whatever was necessary to ensure it was unique.
 If the sender is concerned about collisions, it could prefix the resource id with some constant identifying the sender.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Doug<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"><span style="color:#888888"><br>
<span>--</span><br>
<span>Julien Danjou</span><br>
<span># Free Software hacker & freelance</span><br>
<span># <a href="http://julien.danjou.info" target="_blank">http://julien.danjou.info</a></span></span><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>

<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>