Skip to content

Commit b604e31

Browse files
patrickmannclaude
andcommitted
Expose the search-cluster node name on NodeInfo
The node stats adapter already fetches each node's name from the _nodes response but dropped it: NodeInfo carried only version, OS, roles, and heap, keyed by node id. The System Overview health panel's shard-count check needs to join per-node shard counts (keyed by node name, from _cat/allocation) with per-node heap (keyed by node id, from _nodes), and the only existing id-to-name bridge is a per-node round-trip. Populate the node name in the OpenSearch 2/3 and Elasticsearch 7 adapters so a single _nodes read carries it. Enables Graylog2/graylog-plugin-enterprise#14658. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0271892 commit b604e31

4 files changed

Lines changed: 8 additions & 0 deletions

File tree

graylog-storage-elasticsearch7/src/main/java/org/graylog/storage/elasticsearch7/ClusterAdapterES7.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ public Map<String, NodeInfo> nodesInfo() {
284284

285285
private NodeInfo createNodeInfo(JsonNode nodesJson) {
286286
return NodeInfo.builder()
287+
.name(nodesJson.at("/name").asText())
287288
.version(nodesJson.at("/version").asText())
288289
.os(nodesJson.at("/os"))
289290
.roles(toStream(nodesJson.at("/roles").elements()).map(JsonNode::asText).toList())

graylog-storage-opensearch2/src/main/java/org/graylog/storage/opensearch2/ClusterAdapterOS2.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ public Map<String, NodeInfo> nodesInfo() {
293293

294294
private NodeInfo createNodeInfo(JsonNode nodesJson) {
295295
return NodeInfo.builder()
296+
.name(nodesJson.at("/name").asText())
296297
.version(nodesJson.at("/version").asText())
297298
.os(nodesJson.at("/os"))
298299
.roles(toStream(nodesJson.at("/roles").elements()).map(JsonNode::asText).toList())

graylog-storage-opensearch3/src/main/java/org/graylog/storage/opensearch3/ClusterAdapterOS.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ public Map<String, org.graylog2.system.stats.elasticsearch.NodeInfo> nodesInfo()
315315

316316
private org.graylog2.system.stats.elasticsearch.NodeInfo createNodeInfo(JsonNode nodesJson) {
317317
return org.graylog2.system.stats.elasticsearch.NodeInfo.builder()
318+
.name(nodesJson.at("/name").asText())
318319
.version(nodesJson.at("/version").asText())
319320
.os(nodesJson.at("/os"))
320321
.roles(toStream(nodesJson.at("/roles").elements()).map(JsonNode::asText).toList())

graylog2-server/src/main/java/org/graylog2/system/stats/elasticsearch/NodeInfo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public static Builder builder() {
3030
return new AutoValue_NodeInfo.Builder();
3131
}
3232

33+
@JsonProperty
34+
public abstract String name();
35+
3336
@JsonProperty
3437
public abstract String version();
3538

@@ -44,6 +47,8 @@ public static Builder builder() {
4447

4548
@AutoValue.Builder
4649
public abstract static class Builder {
50+
public abstract Builder name(String name);
51+
4752
public abstract Builder version(String version);
4853

4954
public abstract Builder os(Object os);

0 commit comments

Comments
 (0)