diff options
author | Ola Aunronning <olaa@yahooinc.com> | 2024-03-27 12:48:08 +0100 |
---|---|---|
committer | Ola Aunronning <olaa@yahooinc.com> | 2024-03-27 12:48:08 +0100 |
commit | 4a022158a8d2d500f43b8bb271ad339fd75895b3 (patch) | |
tree | 1e7ee643e4f1486678a434e6b2bd59b071dfabc6 | |
parent | 50e70e3a7b0413210e2275f936d15574a386cb32 (diff) |
Emit suspended seconds. Update metrics for non-active nodes
-rw-r--r-- | metrics/src/main/java/ai/vespa/metrics/set/InfrastructureMetricSet.java | 1 | ||||
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/metrics/src/main/java/ai/vespa/metrics/set/InfrastructureMetricSet.java b/metrics/src/main/java/ai/vespa/metrics/set/InfrastructureMetricSet.java index 38a1b252df9..9479c814e89 100644 --- a/metrics/src/main/java/ai/vespa/metrics/set/InfrastructureMetricSet.java +++ b/metrics/src/main/java/ai/vespa/metrics/set/InfrastructureMetricSet.java @@ -81,6 +81,7 @@ public class InfrastructureMetricSet { addMetric(metrics, ConfigServerMetrics.HAS_WIRE_GUARD_KEY.max()); addMetric(metrics, ConfigServerMetrics.WANT_TO_DEPROVISION.max()); addMetric(metrics, ConfigServerMetrics.SUSPENDED.max()); + addMetric(metrics, ConfigServerMetrics.SUSPENDED_SECONDS.count()); addMetric(metrics, ConfigServerMetrics.SOME_SERVICES_DOWN.max()); addMetric(metrics, ConfigServerMetrics.NODE_FAILER_BAD_NODE.max()); addMetric(metrics, ConfigServerMetrics.LOCK_ATTEMPT_LOCKED_LOAD, EnumSet.of(max,average)); diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java index 69ae4fddb63..e3d72d1189e 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java @@ -169,8 +169,6 @@ public class MetricsReporter extends NodeRepositoryMaintainer { * NB: Keep this metric set in sync with internal configserver metric pre-aggregation */ private void updateNodeMetrics(Node node, ServiceModel serviceModel) { - if (node.state() != State.active) - return; Metric.Context context; Optional<Allocation> allocation = node.allocation(); if (allocation.isPresent()) { @@ -235,7 +233,7 @@ public class MetricsReporter extends NodeRepositoryMaintainer { long suspendedSeconds = info.suspendedSince() .map(suspendedSince -> Duration.between(suspendedSince, clock().instant()).getSeconds()) .orElse(0L); - metric.set(ConfigServerMetrics.SUSPENDED_SECONDS.baseName(), suspendedSeconds, context); + metric.add(ConfigServerMetrics.SUSPENDED_SECONDS.baseName(), suspendedSeconds, context); }); long numberOfServices; |