summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@yahooinc.com>2022-08-23 15:10:53 +0200
committerØyvind Grønnesby <oyving@yahooinc.com>2022-08-23 15:10:53 +0200
commit27e222201bdf0dd8f22bb2586dab1fa83db850c4 (patch)
treec94d685da20ecc5044d6603cc5cca68db39f94d4
parent7e290cd7574f69071490dbfb78da9e2773a863e7 (diff)
Trying to meter staging and test causes 404s
Looks like the application is often removed before we can retrieve the scaling events from the configuration server. Filtering out testing environments to avoid this. Also made the exception slightly more silent.
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainer.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainer.java
index 205fb7e0e79..85588d2cf0f 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainer.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/ResourceMeterMaintainer.java
@@ -17,6 +17,7 @@ import com.yahoo.vespa.hosted.controller.Instance;
import com.yahoo.vespa.hosted.controller.api.identifiers.ClusterId;
import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.Cluster;
+import com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServerException;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.Node;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.NodeFilter;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.NodeRepository;
@@ -159,15 +160,20 @@ public class ResourceMeterMaintainer extends ControllerMaintainer {
}
private Stream<DeploymentId> mapInstanceToDeployments(Instance instance) {
- return instance.deployments().keySet().stream().map(zoneId -> {
- return new DeploymentId(instance.id(), zoneId);
- });
+ return instance.deployments().keySet().stream()
+ .filter(zoneId -> !zoneId.environment().isTest())
+ .map(zoneId -> new DeploymentId(instance.id(), zoneId));
}
private Stream<Map.Entry<ClusterId, List<Cluster.ScalingEvent>>> mapDeploymentToClusterScalingEvent(DeploymentId deploymentId) {
- return nodeRepository.getApplication(deploymentId.zoneId(), deploymentId.applicationId())
- .clusters().entrySet().stream()
- .map(cluster -> Map.entry(new ClusterId(deploymentId, cluster.getKey()), cluster.getValue().scalingEvents()));
+ try {
+ return nodeRepository.getApplication(deploymentId.zoneId(), deploymentId.applicationId())
+ .clusters().entrySet().stream()
+ .map(cluster -> Map.entry(new ClusterId(deploymentId, cluster.getKey()), cluster.getValue().scalingEvents()));
+ } catch (ConfigServerException e) {
+ log.info("Could not retrieve scaling events for " + deploymentId + ": " + e.getMessage());
+ return Stream.empty();
+ }
}
private void reportAllScalingEvents() {