[openstack-dev] [Ceilometer]: Instance creation and deletion metrics in ceilometer !
gordon chung
gord at live.ca
Thu Nov 3 13:07:30 UTC 2016
On 02/11/16 08:10 PM, Adrian Turjak wrote:
>
> On 03/11/16 03:01, gordon chung wrote:
>> gnocchi captures the state of a resource and it's history. this is
>> accessible by looking at resource history. i'm not entirely sure if that
>> handles your case, may you could provide the queries you use and we
>> could figure out equivalent gnocchi queries. i built a ceilometer vs
>> gnocchi usage deck[1] that may help but it's more focused on metrics
>> rather than resource history.
>>
>> [1] http://www.slideshare.net/GordonChung/ceilometer-to-gnocchi
>>
>> cheers,
>
> I'd need to double check exactly what query it is, but it effectively
> amounts to:
> "List all instance metric samples where project_id is <id> and timestamp
> is in time range <start>-<end>"
>
> The time range is an hour + leadin from last hour to catch the last
> sample from the previous window.
>
> We then group by resource id, and for each instance check the metadata.
> If a sample exists, then the instance exists, and depending on what
> states the metadata shows it was in we know for how much of that hour we
> will be billing. Basically, we don't care about the actual volume/data
> of the metric, just the sample metadata from the resource at that point
> in time.
>
> The above is what our billing aggregation service does ever hour against
> ceilometer. So we're not using ceilometer directly for billing, just are
> a source for the data we wish to aggregate and transform into something
> we can bill.
>
> It looks like we can still achieve the same thing in gnocchi with any
> instance metric that has resource metadata (cpu_util) since gnocchi
> stores the changes in the metadata over time. Can we though bypass the
> metric and look at changes in resource metadata directly?
>
yeah, as jd mentioned, it seems like Gnocchi covers your use case and
makes it a bit easier. yes, you can look at resource data and history
without considering metrics (that's actually how it's designed, resource
and metric data separate). you can search for resources or get it's
history[1]. there's an equivalent client call if needed.
[1] http://gnocchi.xyz/rest.html#searching-for-resources
cheers,
--
gord
More information about the OpenStack-dev
mailing list