Warning
Remember that custom modification may result in conflicts with upstream upgrades. If not intended to be merged with upstream, it’s advisable to directly create resource-types via Gnocchi API.
Resource types in Gnocchi are managed by Ceilometer. The following describes how to add/remove or update Gnocchi resource types to support new Ceilometer data.
The modification or creation of Gnocchi resource type definitions are managed :section:`resources_update_operations` of ceilometer/gnocchi_client.py.
The following operations are supported:
{"desc": "add flavor_name to instance",
"type": "update_attribute_type",
"resource_type": "instance",
"data": [{
"op": "add",
"path": "/attributes/flavor_name",
"value": {"type": "string", "min_length": 0, "max_length": 255,
"required": True, "options": {'fill': ''}}
}]}
{"desc": "remove server_group to instance",
"type": "update_attribute_type",
"resource_type": "instance",
"data": [{
"op": "remove",
"path": "/attributes/server_group"
}]}
{"desc": "add nova_compute resource type",
"type": "create_resource_type",
"resource_type": "nova_compute",
"data": [{
"attributes": {"host_name": {"type": "string", "min_length": 0,
"max_length": 255, "required": True}}
}]}
Note
Do not modify the existing change steps when making changes. Each modification requires a new step to be added and for ceilometer-upgrade –skip-metering-database to be run to apply the change to Gnocchi.
With accomplishing sections above, don’t forget to add a new resource type or attributes of a resource type into :the file:ceilometer/dispatcher/data/gnocchi_resources.yaml.