Skip to content

add option to libvirtkvm collector to build instance name based on openstack metadata - #481

Open
biancalana wants to merge 8 commits into
python-diamond:masterfrom
biancalana:libkvm-openstack-metadata
Open

biancalana wants to merge 8 commits into
python-diamond:masterfrom
biancalana:libkvm-openstack-metadata

Conversation

@biancalana

Copy link
Copy Markdown

add option to libvirtkvm collector to build instance name based on openstack metadata, this is useful to group VMs tenant metrics on Openstack.

Comment thread docs/collectors/LibvirtKVMCollector.md Outdated
uri | qemu:///system | The libvirt connection URI. By default it's<br>
'qemu:///system'. One decent option is<br>
'qemu+unix:///system?socket=/var/run/libvirt/libvit-sock-ro'. | str
format_name_using_metadata | False | Use openstack metadata to generate instance name, its useful when do you and to group VMs metrics by project | string, possible options: ${owner_project},${owner_project_uuid},${instance},${instance_uuid}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not in the config option list

@shortdudey123

Copy link
Copy Markdown
Member

Can you update the libvirtkvm collector tests to accommodate your change?

def test_import(self):
self.assertTrue(LibvirtKVMCollector)

@patch('libvirt')

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone can help here ? I need to mock the entire libvirt module...

I'm not a python guy and had never written this kind of tests 💥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants