From 80b95697ca43d3457a7462ae40d893374392e48a Mon Sep 17 00:00:00 2001 From: yngveaasheim Date: Thu, 2 Mar 2023 15:05:31 +0100 Subject: Add enums for more metrics sources --- .../com/yahoo/metrics/ConfigServerMetrics.java | 60 ++++++++++++++++++++++ .../main/java/com/yahoo/metrics/LogdMetrics.java | 33 ++++++++++++ .../java/com/yahoo/metrics/NodeAdminMetrics.java | 36 +++++++++++++ .../java/com/yahoo/metrics/SentinelMetrics.java | 36 +++++++++++++ .../java/com/yahoo/metrics/SlobrokMetrics.java | 37 +++++++++++++ 5 files changed, 202 insertions(+) create mode 100644 container-core/src/main/java/com/yahoo/metrics/ConfigServerMetrics.java create mode 100644 container-core/src/main/java/com/yahoo/metrics/LogdMetrics.java create mode 100644 container-core/src/main/java/com/yahoo/metrics/NodeAdminMetrics.java create mode 100644 container-core/src/main/java/com/yahoo/metrics/SentinelMetrics.java create mode 100644 container-core/src/main/java/com/yahoo/metrics/SlobrokMetrics.java (limited to 'container-core') diff --git a/container-core/src/main/java/com/yahoo/metrics/ConfigServerMetrics.java b/container-core/src/main/java/com/yahoo/metrics/ConfigServerMetrics.java new file mode 100644 index 00000000000..ea87bae1f17 --- /dev/null +++ b/container-core/src/main/java/com/yahoo/metrics/ConfigServerMetrics.java @@ -0,0 +1,60 @@ +package com.yahoo.metrics; + +/** + * @author yngve + */ +public enum ConfigServerMetrics implements VespaMetrics { + + CONFIGSERVER_REQUESTS("configserver.requests", Unit.REQUEST, "Number of requests processed"), + CONFIGSERVER_FAILED_REQUESTS("configserver.failedRequests", Unit.REQUEST, "Number of requests that failed"), + CONFIGSERVER_LATENCY("configserver.latency", Unit.MILLISECOND, "Time to complete requests"), + CONFIGSERVER_CACHE_CONFIG_ELEMS("configserver.cacheConfigElems", Unit.ITEM, "Time to complete requests"), + CONFIGSERVER_CACHE_CHECKSUM_ELEMS("", Unit.ITEM, "Number of checksum elements in the cache"), + CONFIGSERVER_HOSTS("configserver.hosts", Unit.NODE, "The number of nodes being served configuration from the config server cluster"), + CONFIGSERVER_TENANTS("configserver.tenants", Unit.INSTANCE, "The number of tenants being served configuration from the config server cluster"), + CONFIGSERVER_APPLICATIONS("configserver.applications", Unit.INSTANCE, "The number of applications being served configuration from the config server cluster"), + CONFIGSERVER_DELAYED_RESPONSES("configserver.delayedResponses", Unit.RESPONSE, "Number of delayed responses"), + CONFIGSERVER_SESSION_CHANGE_ERRORS("configserver.sessionChangeErrors", Unit.SESSION, "Number of session change errors"), + CONFIGSERVER_UNKNOWN_HOST_REQUEST("configserver.unknownHostRequests", Unit.REQUEST, "Config requests from unknown hosts"), + CONFIGSERVER_NEW_SESSIONS("configserver.newSessions", Unit.SESSION, "New config sessions"), + CONFIGSERVER_PREPARED_SESSIONS("configserver.preparedSessions", Unit.SESSION, "Prepared config sessions"), + CONFIGSERVER_ACTIVE_SESSIONS("configserver.activeSessions", Unit.SESSION, "Active config sessions"), + CONFIGSERVER_INACTIVE_SESSIONS("configserver.inactiveSessions", Unit.SESSION, "Inactive config sessions"), + CONFIGSERVER_ADDED_SESSIONS("configserver.addedSessions", Unit.SESSION, "Added config sessions"), + CONFIGSERVER_REMOVED_SESSIONS("configserver.removedSessions", Unit.SESSION, "Removed config sessions"), + CONFIGSERVER_RPC_SERVER_WORK_QUEUE_SIZE("configserver.rpcServerWorkQueueSize", Unit.ITEM, "Number of elements in the RPC server work queue"), + + // ZooKeeper related metrics + CONFIGSERVER_ZK_CONNECTIONS_LOST("configserver.zkConnectionLost", Unit.CONNECTION, "Number of ZooKeeper connections lost"), + CONFIGSERVER_ZK_RECONNECTED("configserver.zkReconnected", Unit.CONNECTION, "Number of ZooKeeper reconnections"), + CONFIGSERVER_ZK_CONNECTED("configserver.zkConnected", Unit.NODE, "Number of ZooKeeper nodes connected"), + CONFIGSERVER_ZK_SUSPENDED("configserver.zkSuspended", Unit.NODE, "Number of ZooKeeper nodes suspended"), + CONFIGSERVER_ZK_Z_NODES("configserver.zkZNodes", Unit.NODE, "Number of ZooKeeper nodes present"), + CONFIGSERVER_ZK_AVG_LATENCY("configserver.zkAvgLatency", Unit.MILLISECOND, "Average latency for ZooKeeper requests"), // TODO: Confirm metric name + CONFIGSERVER_ZK_MAX_LATENCY("configserver.zkMaxLatency", Unit.MILLISECOND, "Max latency for ZooKeeper requests"), + CONFIGSERVER_ZK_CONNECTIONS("configserver.zkConnections", Unit.CONNECTION, "Number of ZooKeeper connections"), + CONFIGSERVER_ZK_OUTSTANDING_REQUESTS("configserver.zkOutstandingRequests", Unit.REQUEST, "Number of ZooKeeper requests in flight"); + + private final String name; + private final Unit unit; + private final String description; + + ConfigServerMetrics(String name, Unit unit, String description) { + this.name = name; + this.unit = unit; + this.description = description; + } + + public String baseName() { + return name; + } + + public Unit unit() { + return unit; + } + + public String description() { + return description; + } + +} \ No newline at end of file diff --git a/container-core/src/main/java/com/yahoo/metrics/LogdMetrics.java b/container-core/src/main/java/com/yahoo/metrics/LogdMetrics.java new file mode 100644 index 00000000000..fddb1dfc213 --- /dev/null +++ b/container-core/src/main/java/com/yahoo/metrics/LogdMetrics.java @@ -0,0 +1,33 @@ +package com.yahoo.metrics; + +/** + * @author yngve + */ +public enum LogdMetrics implements VespaMetrics { + + LOGD_PROCESSED_LINES("logd.processed.lines", Unit.ITEM, "Number of log lines processed"); + + private final String name; + private final Unit unit; + private final String description; + + LogdMetrics(String name, Unit unit, String description) { + this.name = name; + this.unit = unit; + this.description = description; + } + + public String baseName() { + return name; + } + + public Unit unit() { + return unit; + } + + public String description() { + return description; + } + +} + diff --git a/container-core/src/main/java/com/yahoo/metrics/NodeAdminMetrics.java b/container-core/src/main/java/com/yahoo/metrics/NodeAdminMetrics.java new file mode 100644 index 00000000000..5a13973b31c --- /dev/null +++ b/container-core/src/main/java/com/yahoo/metrics/NodeAdminMetrics.java @@ -0,0 +1,36 @@ +package com.yahoo.metrics; + +/** + * @author yngve + */ +public enum NodeAdminMetrics implements VespaMetrics { + + WORKER_CONNECTIONS("worker.connections", Unit.CONNECTION, "Yahoo! Internal: Number of connections for the routing worker having most connections per node"), // Hosted Vespa only (routing layer) TODO: Move to a better place + ENDPOINT_CERTIFICATE_EXPIRY_SECONDS("endpoint.certificate.expiry.seconds", Unit.SECOND, "Time until node endpoint certificate expires"), + NODE_CERTIFICATE_EXPIRY_SECONDS("node-certificate.expiry.seconds", Unit.SECOND, "Time until node certificate expires"); + + + private final String name; + private final Unit unit; + private final String description; + + NodeAdminMetrics(String name, Unit unit, String description) { + this.name = name; + this.unit = unit; + this.description = description; + } + + public String baseName() { + return name; + } + + public Unit unit() { + return unit; + } + + public String description() { + return description; + } + +} + diff --git a/container-core/src/main/java/com/yahoo/metrics/SentinelMetrics.java b/container-core/src/main/java/com/yahoo/metrics/SentinelMetrics.java new file mode 100644 index 00000000000..7711b7e75f4 --- /dev/null +++ b/container-core/src/main/java/com/yahoo/metrics/SentinelMetrics.java @@ -0,0 +1,36 @@ +package com.yahoo.metrics; + +/** + * @author yngve + */ +public enum SentinelMetrics implements VespaMetrics { + + SENTINEL_RESTARTS("sentinel.restarts", Unit.RESTART, "Number of service restarts done by the sentinel"), + SENTINEL_TOTAL_RESTARTS("sentinel.totalRestarts", Unit.RESTART, "Total number of service restarts done by the sentinel since the sentinel was started"), + SENTINEL_UPTIME("sentinel.uptime", Unit.SECOND, "Time the sentinel has been running"), + SENTINEL_RUNNING("sentinel.running", Unit.INSTANCE, "Number of services the sentinel has running currently"); + + + private final String name; + private final Unit unit; + private final String description; + + SentinelMetrics(String name, Unit unit, String description) { + this.name = name; + this.unit = unit; + this.description = description; + } + + public String baseName() { + return name; + } + + public Unit unit() { + return unit; + } + + public String description() { + return description; + } + +} diff --git a/container-core/src/main/java/com/yahoo/metrics/SlobrokMetrics.java b/container-core/src/main/java/com/yahoo/metrics/SlobrokMetrics.java new file mode 100644 index 00000000000..8c30bf8e414 --- /dev/null +++ b/container-core/src/main/java/com/yahoo/metrics/SlobrokMetrics.java @@ -0,0 +1,37 @@ +package com.yahoo.metrics; + +/** + * @author yngve + */ +public enum SlobrokMetrics implements VespaMetrics { + + SLOBROK_HEARTBEATS_FAILED("slobrok.heartbeats.failed", Unit.REQUEST, "Number of heartbeat requests failed"), + SLOBROK_REQUESTS_REGISTER("slobrok.requests.register", Unit.REQUEST, "Number of register requests received"), + SLOBROK_REQUESTS_MIRROR("slobrok.requests.mirror", Unit.REQUEST, "Number of mirroring requests received"), + SLOBROK_REQUESTS_ADMIN("slobrok.requests.admin", Unit.REQUEST, "Number of administrative requests received"), + SLOBROK_MISSING_CONSENSUS("slobrok.missing.consensus", Unit.SECOND, "Number of seconds without full consensus with all other brokers"); + + + private final String name; + private final Unit unit; + private final String description; + + SlobrokMetrics(String name, Unit unit, String description) { + this.name = name; + this.unit = unit; + this.description = description; + } + + public String baseName() { + return name; + } + + public Unit unit() { + return unit; + } + + public String description() { + return description; + } + +} -- cgit v1.2.3