#labels in a metric not appearing in REST

1 messages · Page 1 of 1 (latest)

hidden rampart
#

IN Zapi, I did this originally, so I could have access to which aggregates disks are associated with.

name: Disk
query: storage-disk-get-iter
object: disk

counters:
storage-disk-info:
- disk-inventory-info:
- ^firmware-revision => firmware_revision
- disk-raid-info:
- disk-aggregate-info:
- ^aggregate-name => aggregate
- disk-shared-info:
- aggregate-list:
- shared-aggregate-info:
- ^aggregate-name => aggregate
plugins:

  • ChangeLog:
    track:
    - disk
    - index
    - node
    - model
    - firmware_revision
    - serial_number
    - outage
    - failed
    - aggregate

export_options:
instance_keys:
- container_type
- failed
- model
- aggregate
instance_labels:
- firmware_revision

It also affords us when any of the items listed in ChangeLog 'changes' so that we can make sure we don't have any disks with incorrect firmware (or we denote we have a newer disk firmware we got when it was replaced, etc)

I was attempting to do this with REST and EVERYTHING works with exception of 'aggregate'. I can't seem to get it to populate like under ZAPI, even though the information is there as it was in ZAPI.

Thoughts?

#

I thought it would simply be '^aggregates.name => aggregate ', but that just results in a blank result for the label 'aggregate="" '

sweet pollen
hidden rampart
#

I tried to follow what was done with home_node.name => owner_node

sweet pollen
#

checking the json response, the difference is home_node is an object and aggregates is an array

#

try this in your rest template
- ^aggregates.#.name => aggregate

hidden rampart
#

that worked

#

is there documentation on how to tell the difference between an array and and object in REST?

#

or is that something known because you have done it for that long?

#

and it exactly does what the original does, so this is awesome

sweet pollen
hidden rampart
#

Ah, I see. That is exactly what the curl call returns, { } for object and [ ] for array as you denoted

#

as an example, "paths" in the curl call for disk is also an array

#

super helpful, thanks

sweet pollen
#

you're welcome!

hidden rampart
#

I'm done with 4 of the 11 modifications I did in ZAPI converting them to REST

#

I hope they are easier now that i have this info!

sweet pollen
#

me too!

hidden rampart
#

also appears to be a larger set of metrics in REST than was in ZAPI

#

I am seeing about 40k more metrics when I move to REST

#

thinks that MORE isn't bad, nor much of a suprise....