zhmcclient / zhmc-prometheus-exporter

A Prometheus exporter for the IBM Z HMC
Apache License 2.0
12 stars 8 forks source link

Support resource in "if" conditions on metrics to avoid warning on "cylinders" #459

Closed andy-maier closed 4 months ago

andy-maier commented 4 months ago

The "cylinders" metric in resource metric group "storagevolume-resource" causes a warning:

...zhmc_prometheus_exporter.py:1401: UserWarning: Skipping metric with exporter name 'cylinders' in resource metric group 'storagevolume-resource' in metric definition file examples/metrics.yaml, because its resource property 'cylinders' is not returned by the HMC

This is because the storage group of the volume has type "fcp" but the "cylinders" property on the storage volume is only present for type "fc".

This warning could be avoided by adding support for defining "if" conditions on metrics that take the resource object into account. (So far, only HMC and SE version can be used in an "if" condition").