openstack team mailing list archive
-
openstack team
-
Mailing list archive
-
Message #13344
Re: [metering] Glance usage data retrieval
Hi Julien and Stuart! Comments inline...
On 06/19/2012 07:12 AM, stuart.mclaren@xxxxxx wrote:
Brian, Jay,
I'll give you a chance to reply to Julien first, but
I have a follow on query...
It doesn't seem like right now Glance produces enough records for full
metering of operations. Eg if you want to charge a specific user for
every successful image upload/image download this information doesn't
'fall out' of the current logs. For example the eventlet output such as:
Jun 19 09:18:39 az1-gl-api-0001 DEBUG 3795 [eventlet.wsgi.server]
127.0.0.1 - - [19/Jun/2012 09:18:39] "GET
/v1/images/4921 HTTP/1.1" 200 104858310 2.098967
doesn't tie the GET operation to a particular user.
As Julien mentions there is an image_upload notification, but I don't
see an equivalent image_download notification.
Yeah, there is one :) It's called image.send:
https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L892
(Note I'm using old Diablo code at the moment, so I'm going on
code inspection of the latest code -- apologies if I missed anything.)
Is the creation of records of operations in a well-defined format which
can be consumed by eg a Metering and Billing team something we'd
like to have? (I'm ignoring Data at Rest metering for now.)
Not sure about this one, but I believe the message format is the same as
Nova:
https://github.com/openstack/glance/blob/master/glance/notifier/__init__.py#L55
With the exception of the request ID. The payload is structured here for
downloads:
https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L882
If so, would something along the following lines be worth considering?
A wsgi filter, using a mechanism similar to Swift's posthooklogger, which
has a routine which is called when operations are about to complete. It
should have access to the context (http return status, user, operation
etc) so would be able to raise a notification if appropriate. Using a
standard notifier would mean output could be to a log file or, perhaps
in time, the notifications could be consumed by ceilometer.
LOL, that's actually how it currently works :)
https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L917
All the best,
-jay
-Stuart
On Tue, 19 Jun 2012, Julien Danjou wrote:
Hello,
As part of the ceilometer project¹, we're working on usage data
retrieval from various OpenStack components. One of them is Glance.
We're targeting Folsom for the first release, therefore it seems
important for both projects to be able to work together, this is why
we're bringing ceilometer to your attention and asking for advices. :)
What we want is to retrieve the maximum amount of data, so we can meter
things, to bill them in the end. For now and for Glance, this only
includes the number of image uploaded (per user/tenant), but we'll need
probaly more in a near future.
At this point we plan to plug into the notification system, since it
seems to be what Glance provides to accomplish this. And so far, the
notifications provided seem enough to accomplish what we want to do.
Do you have any advice regarding integration of Ceilometer and Glance
together? Is this something a stable interface we can rely on, or is
there a better way to do so?
Thanks in advance,
Regards,
¹ http://launchpad.net/ceilometer
--
Julien Danjou
// eNovance http://enovance.com
// ✉ julien.danjou@xxxxxxxxxxxx ☎ +33 1 49 70 99 81
_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp
References