diff --git a/docs/changes.rst b/docs/changes.rst index 25d5813b..58006c74 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -96,6 +96,10 @@ Released: not yet * Added support for HTTPS and mutual TLS (mTLS) by adding a new optional section 'prometheus' to the HMC credentials file. (issue #347) +* Tolerated when unknown 'resource' types are specified in the metrics.yaml + file, because one possible reason for that is that a newer metrics.yaml file + is being used. (issue #379) + **Cleanup:** **Known issues:** diff --git a/zhmc_prometheus_exporter/zhmc_prometheus_exporter.py b/zhmc_prometheus_exporter/zhmc_prometheus_exporter.py index c7431a05..fd801214 100755 --- a/zhmc_prometheus_exporter/zhmc_prometheus_exporter.py +++ b/zhmc_prometheus_exporter/zhmc_prometheus_exporter.py @@ -746,12 +746,11 @@ def create_metrics_context(session, yaml_metric_groups, hmc_version): resources[metric_group].append(sv) uri2resource[sv.uri] = sv else: - new_exc = ImproperExit( - "Invalid 'resource' item in resource metric group {} in " - "metrics file: {}". - format(metric_group, resource_path)) - new_exc.__cause__ = None # pylint: disable=invalid-name - raise new_exc + logprint(logging.ERROR, PRINT_ALWAYS, + "Ignoring invalid 'resource' item {rp!r} in resource " + "metric group {mg!r} in metrics file (Is the metrics file " + "newer than the exporter program?)". + format(rp=resource_path, mg=metric_group)) return context, resources, uri2resource