From 24ec1bace314fd076553b00df7b84ec32487c839 Mon Sep 17 00:00:00 2001 From: Aleksandra Malinowska Date: Wed, 13 Nov 2019 16:12:45 +0100 Subject: [PATCH] Fix metrics for list and delete instances --- cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go index 1d0a65beaa5..13b83638a8e 100644 --- a/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go +++ b/cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go @@ -183,13 +183,13 @@ func (client *autoscalingGceClientV1) waitForOp(operation *gce.Operation, projec } func (client *autoscalingGceClientV1) DeleteInstances(migRef GceRef, instances []GceRef) error { + registerRequest("instance_group_managers", "delete_instances") req := gce.InstanceGroupManagersDeleteInstancesRequest{ Instances: []string{}, } for _, i := range instances { req.Instances = append(req.Instances, GenerateInstanceUrl(i)) } - registerRequest("instance_group_managers", "delete_instances") op, err := client.gceService.InstanceGroupManagers.DeleteInstances(migRef.Project, migRef.Zone, migRef.Name, &req).Do() if err != nil { return err @@ -198,6 +198,7 @@ func (client *autoscalingGceClientV1) DeleteInstances(migRef GceRef, instances [ } func (client *autoscalingGceClientV1) FetchMigInstances(migRef GceRef) ([]cloudprovider.Instance, error) { + registerRequest("instance_group_managers", "list_managed_instances") gceInstances, err := client.gceService.InstanceGroupManagers.ListManagedInstances(migRef.Project, migRef.Zone, migRef.Name).Do() if err != nil { klog.V(4).Infof("Failed MIG info request for %s %s %s: %v", migRef.Project, migRef.Zone, migRef.Name, err)