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:
parent
a9fdabb520
commit
c31425f83b
@ -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()
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user