ceilometer/releasenotes/notes/add-map-trait-plugin-0d969f5cc7b18175.yaml
Callum Dickinson d1ba90b3c3 Add a map event trait plugin
Add a new map event trait plugin for mapping one set of values
to another.

This is useful, for example, when you wish to express the state
of a resource as the volume for the resulting samples:

metric:
  - name: 'instance'
    event_type: *instance_events
    type: 'gauge'
    unit: 'instance'
    volume:
      fields: [$.payload.state]
      plugin:
        name: map
        parameters:
          values:
            BUILDING: 0  # VM only exists in DB
            ACTIVE: 1  # VM is running
            PAUSED: 2  # VM is suspended to RAM
            SUSPENDED: 3  # VM is suspended to disk
            STOPPED: 4  # VM is temporarily powered off
            RESCUED: 5  # A rescue image is running
            RESIZED: 6  # VM active with a new size is active
            SOFT_DELETED: 7  # VM deleted but not permanently removed
            DELETED: 8  # VM is permanently deleted
            ERROR: 9  # VM is in error state
            SHELVED: 10  # VM is powered off, still on hypervisor
            SHELVED_OFFLOADED: 11  # VM is powered off, off hypervisor
          default: -1
          case_sensitive: false
    user_id: $.payload.user_id
    project_id: $.payload.tenant_id
    resource_id: $.payload.instance_id
    user_metadata: $.payload.metadata
    metadata:
      <<: *instance_meta

Change-Id: I9469cbf8baeec543ffe152b8b5bf07595fa6905a
2025-02-26 17:02:21 +13:00

11 lines
379 B
YAML

---
features:
- |
A ``map`` event trait plugin has been added.
This allows notification meter attributes to be created
by mapping one set of values from an attribute to another
set of values defined in the meter definition.
Additional options are also available for controlling
how to handle edge cases, such as unknown values and
case sensitivity.