---

resources:
  - resource_type: identity
    metrics:
      - 'identity.authenticate.success'
      - 'identity.authenticate.pending'
      - 'identity.authenticate.failure'
      - 'identity.user.created'
      - 'identity.user.deleted'
      - 'identity.user.updated'
      - 'identity.group.created'
      - 'identity.group.deleted'
      - 'identity.group.updated'
      - 'identity.role.created'
      - 'identity.role.deleted'
      - 'identity.role.updated'
      - 'identity.project.created'
      - 'identity.project.deleted'
      - 'identity.project.updated'
      - 'identity.trust.created'
      - 'identity.trust.deleted'
      - 'identity.role_assignment.created'
      - 'identity.role_assignment.deleted'

  - resource_type: ceph_account
    metrics:
      - 'radosgw.objects'
      - 'radosgw.objects.size'
      - 'radosgw.objects.containers'
      - 'radosgw.api.request'
      - 'radosgw.containers.objects'
      - 'radosgw.containers.objects.size'

  - resource_type: instance
    metrics:
      - 'memory'
      - 'memory.usage'
      - 'memory.resident'
      - 'memory.swap.in'
      - 'memory.swap.out'
      - 'memory.bandwidth.total'
      - 'memory.bandwidth.local'
      - 'vcpus'
      - 'cpu'
      - 'cpu.delta'
      - 'cpu_util'
      - 'cpu_l3_cache'
      - 'disk.root.size'
      - 'disk.ephemeral.size'
      - 'disk.read.requests'
      - 'disk.read.requests.rate'
      - 'disk.write.requests'
      - 'disk.write.requests.rate'
      - 'disk.read.bytes'
      - 'disk.read.bytes.rate'
      - 'disk.write.bytes'
      - 'disk.write.bytes.rate'
      - 'disk.latency'
      - 'disk.iops'
      - 'disk.capacity'
      - 'disk.allocation'
      - 'disk.usage'
      - 'compute.instance.booting.time'
      - 'perf.cpu.cycles'
      - 'perf.instructions'
      - 'perf.cache.references'
      - 'perf.cache.misses'
    attributes:
      host: resource_metadata.(instance_host|host)
      image_ref: resource_metadata.image_ref
      display_name: resource_metadata.display_name
      flavor_id: resource_metadata.(instance_flavor_id|(flavor.id)|flavor_id)
      flavor_name: resource_metadata.(instance_type|(flavor.name)|flavor_name)
      server_group: resource_metadata.user_metadata.server_group
    event_delete: compute.instance.delete.start
    event_attributes:
      id: instance_id
    event_associated_resources:
      instance_network_interface: '{"=": {"instance_id": "%s"}}'
      instance_disk: '{"=": {"instance_id": "%s"}}'

  - resource_type: instance_network_interface
    metrics:
      - 'network.outgoing.packets.rate'
      - 'network.incoming.packets.rate'
      - 'network.outgoing.packets'
      - 'network.incoming.packets'
      - 'network.outgoing.packets.drop'
      - 'network.incoming.packets.drop'
      - 'network.outgoing.packets.error'
      - 'network.incoming.packets.error'
      - 'network.outgoing.bytes.rate'
      - 'network.incoming.bytes.rate'
      - 'network.outgoing.bytes'
      - 'network.incoming.bytes'
    attributes:
      name: resource_metadata.vnic_name
      instance_id: resource_metadata.instance_id

  - resource_type: instance_disk
    metrics:
      - 'disk.device.read.requests'
      - 'disk.device.read.requests.rate'
      - 'disk.device.write.requests'
      - 'disk.device.write.requests.rate'
      - 'disk.device.read.bytes'
      - 'disk.device.read.bytes.rate'
      - 'disk.device.write.bytes'
      - 'disk.device.write.bytes.rate'
      - 'disk.device.latency'
      - 'disk.device.iops'
      - 'disk.device.capacity'
      - 'disk.device.allocation'
      - 'disk.device.usage'
    attributes:
      name: resource_metadata.disk_name
      instance_id: resource_metadata.instance_id

  - resource_type: image
    metrics:
      - 'image.size'
      - 'image.download'
      - 'image.serve'
    attributes:
      name: resource_metadata.name
      container_format: resource_metadata.container_format
      disk_format: resource_metadata.disk_format
    event_delete: image.delete
    event_attributes:
      id: resource_id

  - resource_type: ipmi
    metrics:
      - 'hardware.ipmi.node.power'
      - 'hardware.ipmi.node.temperature'
      - 'hardware.ipmi.node.inlet_temperature'
      - 'hardware.ipmi.node.outlet_temperature'
      - 'hardware.ipmi.node.fan'
      - 'hardware.ipmi.node.current'
      - 'hardware.ipmi.node.voltage'
      - 'hardware.ipmi.node.airflow'
      - 'hardware.ipmi.node.cups'
      - 'hardware.ipmi.node.cpu_util'
      - 'hardware.ipmi.node.mem_util'
      - 'hardware.ipmi.node.io_util'

  - resource_type: network
    metrics:
      - 'bandwidth'
      - 'ip.floating'
    event_delete: floatingip.delete.end
    event_attributes:
      id: resource_id

  - resource_type: stack
    metrics:
      - 'stack.create'
      - 'stack.update'
      - 'stack.delete'
      - 'stack.resume'
      - 'stack.suspend'

  - resource_type: swift_account
    metrics:
      - 'storage.objects.incoming.bytes'
      - 'storage.objects.outgoing.bytes'
      - 'storage.api.request'
      - 'storage.objects.size'
      - 'storage.objects'
      - 'storage.objects.containers'
      - 'storage.containers.objects'
      - 'storage.containers.objects.size'

  - resource_type: volume
    metrics:
      - 'volume'
      - 'volume.size'
      - 'snapshot.size'
      - 'volume.snapshot.size'
      - 'volume.backup.size'
    attributes:
      display_name: resource_metadata.(display_name|name)
      volume_type: resource_metadata.volume_type
    event_delete: volume.delete.start
    event_attributes:
      id: resource_id

  - resource_type: host
    metrics:
      - 'hardware.cpu.load.1min'
      - 'hardware.cpu.load.5min'
      - 'hardware.cpu.load.15min'
      - 'hardware.cpu.util'
      - 'hardware.memory.total'
      - 'hardware.memory.used'
      - 'hardware.memory.swap.total'
      - 'hardware.memory.swap.avail'
      - 'hardware.memory.buffer'
      - 'hardware.memory.cached'
      - 'hardware.network.ip.outgoing.datagrams'
      - 'hardware.network.ip.incoming.datagrams'
      - 'hardware.system_stats.cpu.idle'
      - 'hardware.system_stats.io.outgoing.blocks'
      - 'hardware.system_stats.io.incoming.blocks'
    attributes:
      host_name: resource_metadata.resource_url

  - resource_type: host_disk
    metrics:
      - 'hardware.disk.size.total'
      - 'hardware.disk.size.used'
    attributes:
      host_name: resource_metadata.resource_url
      device_name: resource_metadata.device

  - resource_type: host_network_interface
    metrics:
      - 'hardware.network.incoming.bytes'
      - 'hardware.network.outgoing.bytes'
      - 'hardware.network.outgoing.errors'
    attributes:
      host_name: resource_metadata.resource_url
      device_name: resource_metadata.name

  - resource_type: nova_compute
    metrics:
      - 'compute.node.cpu.frequency'
      - 'compute.node.cpu.idle.percent'
      - 'compute.node.cpu.idle.time'
      - 'compute.node.cpu.iowait.percent'
      - 'compute.node.cpu.iowait.time'
      - 'compute.node.cpu.kernel.percent'
      - 'compute.node.cpu.kernel.time'
      - 'compute.node.cpu.percent'
      - 'compute.node.cpu.user.percent'
      - 'compute.node.cpu.user.time'
    attributes:
      host_name: resource_metadata.host

  - resource_type: manila_share
    metrics:
      - 'manila.share.size'
    attributes:
      name: resource_metadata.name
      host: resource_metadata.host
      status: resource_metadata.status
      availability_zone: resource_metadata.availability_zone
      protocol: resource_metadata.protocol

  - resource_type: switch
    metrics:
      - 'switch'
      - 'switch.ports'
    attributes:
      controller: resource_metadata.controller

  - resource_type: switch_port
    metrics:
      - 'switch.port'
      - 'switch.port.uptime'
      - 'switch.port.receive.packets'
      - 'switch.port.transmit.packets'
      - 'switch.port.receive.bytes'
      - 'switch.port.transmit.bytes'
      - 'switch.port.receive.drops'
      - 'switch.port.transmit.drops'
      - 'switch.port.receive.errors'
      - 'switch.port.transmit.errors'
      - 'switch.port.receive.frame_error'
      - 'switch.port.receive.overrun_error'
      - 'switch.port.receive.crc_error'
      - 'switch.port.collision.count'
    attributes:
      switch: resource_metadata.switch
      port_number_on_switch: resource_metadata.port_number_on_switch
      neutron_port_id: resource_metadata.neutron_port_id
      controller: resource_metadata.controller

  - resource_type: port
    metrics:
      - 'port'
      - 'port.uptime'
      - 'port.receive.packets'
      - 'port.transmit.packets'
      - 'port.receive.bytes'
      - 'port.transmit.bytes'
      - 'port.receive.drops'
      - 'port.receive.errors'
    attributes:
      controller: resource_metadata.controller

  - resource_type: switch_table
    metrics:
      - 'switch.table.active.entries'
    attributes:
      controller: resource_metadata.controller
      switch: resource_metadata.switch
