Using metering for compute resources
You can collect usage data of compute resources using Gnocchi. This time series database processes and stores measurement data of compute resources and provides access to it via REST API or the command-line tool.
Measurements can be sampled from such compute resources as virtual machines, VM disks and interfaces, compute networks, volumes, etc. All resources are being revised: if any attribute of a resource changes, this change is recorded in the history of the resource. For a VM, for example, you can measure the amount of allocated memory and virtual CPUs, as well as the memory and CPU usage.
An entity storing aggregates composed of a timestamp and value is called a metric. A metric is attached to a specific resource and associated to an archive policy. A policy defines how long aggregates are kept in a metric and how they are computed (minimum, maximum, average, etc.).
Two default archive policies, low
and ceilometer-low-rate
, are used for storing metrics. These policies imply that all computed aggregates are kept for one month with 5-minute granularity. The differences between them are the following:
ceilometer-low-rate
is used for cumulative metrics and stores only mean values and the average of delta values per intervallow
is used for gauge metrics and stores minimum, maximum, and mean values, standard deviation, as well as the sum and number of all measurements
The following metrics are available for aggregation:
Metric | Type | Resource type | Description |
---|---|---|---|
memory
|
gauge | instance | Amount of RAM allocated to the VM, in megabytes |
memory.usage
|
gauge | instance | Percentage of RAM used by the VM |
vcpus
|
gauge | instance | Number of virtual CPUs allocated to the VM |
cpu
|
cumulative | instance | Amount of CPU time used by the VM, in nanoseconds |
disk.device.read.requests
|
cumulative | instance_disk | Number of read requests |
disk.device.write.requests
|
cumulative | instance_disk | Number of write requests |
disk.device.read.bytes
|
cumulative | instance_disk | Amount of data read, in bytes |
disk.device.write.bytes
|
cumulative | instance_disk | Amount of data written, in bytes |
network.incoming.bytes
|
cumulative | instance_network_interface | Incoming network traffic, in bytes |
network.outgoing.bytes
|
cumulative | instance_network_interface | Outgoing network traffic, in bytes |
network.incoming.packets
|
cumulative | instance_network_interface | Incoming network traffic, in packets |
network.outgoing.packets
|
cumulative | instance_network_interface | Outgoing network traffic, in packets |
image.size
|
gauge | image | Size of the uploaded image, in bytes |
volume.size
|
gauge | volume | Size of the volume, in gigabytes |
snapshot.size
|
gauge | volume | Size of the volume snapshot, in gigabytes |
magnum.cluster
|
gauge | coe_cluster | Number of Container Orchestration Engine (COE), that is, Kubernetes clusters |
bandwidth
|
delta | network | Incoming and outgoing network traffic for a physical compute network, in bytes |
Cumulative metrics are polled every 5 minutes and increase over time, delta metrics are polled every 5 minutes and change over time, and gauge metrics are updated on events and show fluctuating values.
Prerequisites
- The billing metering service is installed, as explained in Provisioning billing metering.