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 self, data): clients 'meter_ type'] = 'gauge' 'counter_ type'] = 'gauge'
+++ watchrule.py 2015-05-15 18:08:53.509800025 +0900
@@ -270,20 +270,20 @@
def _to_ceilometer(
clients = self.context.
sample = {}
- sample[
+ sample[
for k, d in iter(data.items()):
continue 'meter_ name'] = k 'sample_ volume' ] = d['Value'] 'meter_ unit'] = d['Unit'] 'counter_ name'] = k 'counter_ volume' ] = d['Value'] 'counter_ unit'] = d['Unit']
dims = dims[0]
sample[ 'resource_ metadata' ] = dims
sample[ 'resource_ id'] = dims.get( 'InstanceId' )
'k': k, 'sample': sample})
clients. client( 'ceilometer' ).samples. create( **sample)
if k == 'Namespace':
- sample[
- sample[
- sample[
+ sample[
+ sample[
+ sample[
dims = d.get('Dimensions', {})
if isinstance(dims, list):
- LOG.debug('new sample:%(k)s data:%(sample)s' % {
+ LOG.info('new sample:%(k)s data:%(sample)s' % {