Deprecate aggregated disk.* metrics on instance

disk.* are just aggregates of disk.device.*. We
basically build the same think twice.

It's up to the backend (ie: Gnocchi) to aggregate them
if someone want the aggregate.

Change-Id: I612b575004f65665f8630f19f56c2fb3637448fd
This commit is contained in:
Mehdi Abaakouk 2017-07-06 15:55:40 +02:00
parent 1a152e1498
commit 1e673a64b9
3 changed files with 20 additions and 4 deletions

View File

@ -23,6 +23,8 @@ from ceilometer import sample
LOG = log.getLogger(__name__)
AGGREGATED_DEPRECATION_DONE = set()
class AggregateDiskPollster(pollsters.GenericComputePollster):
inspector_method = "inspect_disks"
@ -44,6 +46,14 @@ class AggregateDiskPollster(pollsters.GenericComputePollster):
def get_additional_metadata(instance, stats):
return {'device': stats.device}
def get_samples(self, *args, **kwargs):
if self.sample_name not in AGGREGATED_DEPRECATION_DONE:
AGGREGATED_DEPRECATION_DONE.add(self.sample_name)
LOG.warning("The %s metric is deprecated, instead use %s" %
(self.sample_name,
self.sample_name.replace("disk.", "disk.device.")))
return super(AggregateDiskPollster, self).get_samples(*args, **kwargs)
class PerDeviceDiskPollster(pollsters.GenericComputePollster):
inspector_method = "inspect_disks"

View File

@ -10,10 +10,10 @@ sources:
- network.incoming.packets
- network.outgoing.bytes
- network.outgoing.packets
- disk.read.bytes
- disk.read.requests
- disk.write.bytes
- disk.write.requests
- disk.device.read.bytes
- disk.device.read.requests
- disk.device.write.bytes
- disk.device.write.requests
- hardware.cpu.util
- hardware.memory.used
- hardware.memory.total

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
disk.* aggregated metrics for instance are deprecated, in favor of the
per disk metrics (disk.device.*). Now, it's up to the backend to provide
such aggregation feature. Gnocchi already provides this.