Fixed error when having multiple metrics in same plot

This commit is contained in:
Alberto 2023-05-04 18:46:54 +02:00
parent 176c266e48
commit b68fad642f
1 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,8 @@ def fetch_cadvisor_stats_from_prometheus(metrics, prom, container_ip, start_ts,
for metric in metrics["to_query"].values():
if type(metric["metric_name"]) is list:
metric["values"] = [[] for _ in range(len(metric["metric_name"]))]
if "values" not in metric.keys():
metric["values"] = [[] for _ in range(len(metric["metric_name"]))]
for i, submetric in enumerate(metric["metric_name"]):
values = fetch_metric(prom, submetric, container_ip, start_timestamp, end_timestamp,
metric["toMB"])