Use 'meta' in the check_openstack_api plugin

This change modifies the check_openstack_api collectd plugin to provide
the 'region' value in the 'meta' dict instead of 'type_instance'.

Change-Id: Ia5e63ecef34bf61583b29ce9bade3b9f9e0d30f6
This commit is contained in:
Simon Pasquier 2016-03-11 14:24:25 +01:00
parent a9fdabb520
commit c31425f83b
2 changed files with 3 additions and 5 deletions

View File

@ -103,11 +103,9 @@ class APICheckPlugin(openstack.CollectdPlugin):
plugin=PLUGIN_NAME,
plugin_instance=item['service'],
type='gauge',
type_instance=item['region'],
interval=INTERVAL,
values=[item['status']],
# w/a for https://github.com/collectd/collectd/issues/716
meta={'0': True}
meta={'region': item['region']}
)
value.dispatch()

View File

@ -178,8 +178,8 @@ function process_message ()
msg['Fields']['name'] = 'openstack_check_api'
msg['Fields']['service'] = sample['plugin_instance']
msg['Fields']['tag_fields'] = { 'service' }
if sample['type_instance'] ~= nil and sample['type_instance'] ~= '' then
msg['Fields']['os_region'] = sample['type_instance']
if sample['meta'] then
msg['Fields']['os_region'] = sample['meta']['region']
end
elseif metric_source == 'hypervisor_stats' then
-- Metrics from the OpenStack hypervisor metrics where