2015-05-15 10:08:46 |
okamototk |
description |
Heat could not create samples with Ceilometer.
I'm not expert but meter_xxx parameter seems wrong in Heat.
Following patch works for me.
--- watchrule.py.org 2015-05-15 17:48:38.351871774 +0900
+++ watchrule.py 2015-05-15 18:08:53.509800025 +0900
@@ -270,20 +270,20 @@
def _to_ceilometer(self, data):
clients = self.context.clients
sample = {}
- sample['meter_type'] = 'gauge'
+ sample['counter_type'] = 'gauge'
for k, d in iter(data.items()):
if k == 'Namespace':
continue
- sample['meter_name'] = k
- sample['sample_volume'] = d['Value']
- sample['meter_unit'] = d['Unit']
+ sample['counter_name'] = k
+ sample['counter_volume'] = d['Value']
+ sample['counter_unit'] = d['Unit']
dims = d.get('Dimensions', {})
if isinstance(dims, list):
dims = dims[0]
sample['resource_metadata'] = dims
sample['resource_id'] = dims.get('InstanceId')
- LOG.debug('new sample:%(k)s data:%(sample)s' % {
+ LOG.info('new sample:%(k)s data:%(sample)s' % {
'k': k, 'sample': sample})
clients.client('ceilometer').samples.create(**sample) |
Heat could not create samples with Ceilometer.
I'm not expert but meter_xxx parameter seems wrong in Heat.
Following patch works for me.
--- watchrule.py.org 2015-05-15 17:48:38.351871774 +0900
+++ watchrule.py 2015-05-15 18:08:53.509800025 +0900
@@ -270,20 +270,20 @@
def _to_ceilometer(self, data):
clients = self.context.clients
sample = {}
- sample['meter_type'] = 'gauge'
+ sample['counter_type'] = 'gauge'
for k, d in iter(data.items()):
if k == 'Namespace':
continue
- sample['meter_name'] = k
- sample['sample_volume'] = d['Value']
- sample['meter_unit'] = d['Unit']
+ sample['counter_name'] = k
+ sample['counter_volume'] = d['Value']
+ sample['counter_unit'] = d['Unit']
dims = d.get('Dimensions', {})
if isinstance(dims, list):
dims = dims[0] |
|