diff --git a/src/plugin/manager/cost_manager.py b/src/plugin/manager/cost_manager.py index 0dbd9e1..3810a8d 100644 --- a/src/plugin/manager/cost_manager.py +++ b/src/plugin/manager/cost_manager.py @@ -217,23 +217,25 @@ def _check_required_fields(result: dict): @staticmethod def _make_additional_info(result: dict, service_account_id: str) -> dict: additional_info = { - "Cluster": result["metric"].get("cluster", "__idle__"), "X-Scope-OrgID": service_account_id, } - if node := result["metric"].get("node", "__idle__"): + if cluster := result["metric"].get("cluster"): + additional_info["Cluster"] = cluster + + if node := result["metric"].get("node"): additional_info["Node"] = node - if namespace := result["metric"].get("namespace", "__idle__"): + if namespace := result["metric"].get("namespace"): additional_info["Namespace"] = namespace - if pod := result["metric"].get("pod", "__idle__"): + if pod := result["metric"].get("pod"): additional_info["Pod"] = pod - if container := result["metric"].get("container", "__idle__"): + if container := result["metric"].get("container"): additional_info["Container"] = container - if pv := result["metric"].get("persistentvolume", ""): + if pv := result["metric"].get("persistentvolume"): additional_info["PV"] = pv return additional_info