← Back to team overview

openstack team mailing list archive

Re: Clarification on Ceilometer Implementation

 

On Wed, Jun 6, 2012 at 5:33 AM, Kobagana Kumar <
kobagana_kumar@xxxxxxxxxxxxxxxx> wrote:

>  Hi all,****
>
> ** **
>
> I am trying to implement Agent module in Ceilometer. Regarding that I ****
>
> have few doubts:****
>
> ** **
>
> How Ceilometer capturing the usage details?****
>
> ** **
>
> As we are already know "nova simple usage" module captures the usage ****
>
> details of nova. It works at API level. But here in ceilometer we are ****
>
> trying to implement Agent module at compute level. For that how can we ***
> *
>
> capture the usage details?
>

Most of the ceilometer agents are going to run at a low level and talk
directly to the hypervisor or network manager. For example, the pollsters
that Julien wrote use libvirt to get the CPU utilization and disk I/O for a
VM.

You don't say what your plugin is going to measure, so I can't be much more
specific than that.


> ****
>
> ** **
>
> ** **
>
> What is the format of Plug- In?****
>
> ** **
>
> We can implement plug–in in various ways. We can use dictionary format,***
> *
>
> JSON format, etc. In which format Ceilometer implementing the plug – in **
> **
>
> and what are the attributes in that.
>

We need to write some developer documentation, but we only finished the
first implementation very recently. Until we have better docs, your best
source of information is going to be (unfortunately) the source for the
existing pollsters (in the ceilometer.compute package, look at libvirt.py
and network.py). I will try to summarize what you need to be looking for:

An agent plugin (a.k.a., "pollster") is a Python class derived from
ceilometer.plugin.PollsterBase. You need to implement the get_counters()
 method in your class. It should return an iterable containing
ceilometer.counter.Counter instances filled in with the appropriate data.
The code that calls the plugin will format the data from the Counter as a
message and publish it, so your plugin doesn't have to worry about that at
all.

To register the plugin with the agent, create a setuptools entrypoint using
the ceilometer.poll.compute namespace (see the setup.py for ceilometer for
some examples). If we create a ceilometer agent process that needs to run
on non-compute nodes, we will create another namespace for the pollster
plugins.

Let me know if that information raises more specific questions about how to
implement a plugin.

Doug

References