aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOla Aunrønning <olaa@vespa.ai>2024-03-27 14:32:33 +0100
committerGitHub <noreply@github.com>2024-03-27 14:32:33 +0100
commit4763e1a2e98ca25c9e08d1d3516a721e9b1dbcc6 (patch)
tree146d5363d0ca7df32a0d232e13a876513cd143fc
parent680f29db27d18fa1c2c957b92fb8bb2c67509dc6 (diff)
parent4a022158a8d2d500f43b8bb271ad339fd75895b3 (diff)
Merge pull request #30744 from vespa-engine/olaa/nonactive-node-metrics
Emit suspended seconds. Update metrics for non-active nodes
-rw-r--r--metrics/src/main/java/ai/vespa/metrics/set/InfrastructureMetricSet.java1
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/MetricsReporter.java4
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;