Add quantity mutation to Prometheus collector

The Prometheus collector was ignoring the mutate definition from
metrics.yml, which may produce wrong resource ratings.

Change-Id: I662f6ac798c20ca43028b3807fa03aacfdcf252b
Signed-off-by: Ning Yao <yaoning@unitedstack.com>
Story: 2008122
Task: 40844
This commit is contained in:
Ning Yao 2020-02-29 01:16:39 +08:00 committed by Pierre Riteau
parent cbcdacac61
commit 1eb8ecf1f4
2 changed files with 5 additions and 0 deletions

View File

@ -145,6 +145,7 @@ class PrometheusCollector(collector.BaseCollector):
self.conf[metric_name]['factor'],
self.conf[metric_name]['offset'],
)
qty = ck_utils.mutate(qty, self.conf[metric_name]['mutate'])
return metadata, groupby, qty

View File

@ -0,0 +1,4 @@
---
issues:
- |
The Prometheus collector now applies quantity mutation on metrics.