Skip to content

Commit 1be8c94

Browse files
author
Arvind Thirumurugan
committed
fix metric collection
Signed-off-by: Arvind Thirumurugan <[email protected]>
1 parent b18853a commit 1be8c94

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pkg/controllers/metriccollector/collector.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,9 @@ func (r *Reconciler) collectFromPrometheus(ctx context.Context, mc *placementv1b
174174
workloadMetrics := make([]placementv1beta1.WorkloadMetrics, 0, len(data.Result))
175175
for _, res := range data.Result {
176176
namespace := res.Metric["namespace"]
177-
clusterName := res.Metric["cluster_name"]
178-
workloadName := res.Metric["workload_name"]
177+
workloadName := res.Metric["app"]
179178

180-
if namespace == "" || clusterName == "" || workloadName == "" {
179+
if namespace == "" || workloadName == "" {
181180
continue
182181
}
183182

@@ -191,7 +190,6 @@ func (r *Reconciler) collectFromPrometheus(ctx context.Context, mc *placementv1b
191190

192191
wm := placementv1beta1.WorkloadMetrics{
193192
Namespace: namespace,
194-
ClusterName: clusterName,
195193
WorkloadName: workloadName,
196194
Health: health == 1.0, // Convert to boolean: 1.0 = true, 0.0 = false
197195
}

0 commit comments

Comments
 (0)