From 3416ed073b7699d8eb9f5543b16b0e9a960722f8 Mon Sep 17 00:00:00 2001 From: Piotr Piotrowski Date: Thu, 18 Sep 2025 13:03:39 +0200 Subject: [PATCH] [ADDED] New fields in ClusterInfo (#1935) Signed-off-by: Piotr Piotrowski --- jetstream/stream_config.go | 17 ++++++++++++++++- jsm.go | 10 +++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/jetstream/stream_config.go b/jetstream/stream_config.go index 9c22cba..684ab00 100644 --- a/jetstream/stream_config.go +++ b/jetstream/stream_config.go @@ -279,10 +279,25 @@ type ( // Name is the name of the cluster. Name string `json:"name,omitempty"` + // RaftGroup is the name of the Raft group managing the asset (in + // clustered environments). + RaftGroup string `json:"raft_group,omitempty"` + // Leader is the server name of the RAFT leader. Leader string `json:"leader,omitempty"` - // Replicas is the list of members of the RAFT cluster + // LeaderSince is the time that it was elected as leader in RFC3339 + // format, absent when not the leader. + LeaderSince *time.Time `json:"leader_since,omitempty"` + + // SystemAcc indicates if the traffic_account is the system account. + // When true, replication traffic goes over the system account. + SystemAcc bool `json:"system_account,omitempty"` + + // TrafficAcc is the account where the replication traffic goes over. + TrafficAcc string `json:"traffic_account,omitempty"` + + // Replicas is the list of members of the RAFT cluster. Replicas []*PeerInfo `json:"replicas,omitempty"` } diff --git a/jsm.go b/jsm.go index bae376e..eaa2f63 100644 --- a/jsm.go +++ b/jsm.go @@ -1093,9 +1093,13 @@ type StreamState struct { // ClusterInfo shows information about the underlying set of servers // that make up the stream or consumer. type ClusterInfo struct { - Name string `json:"name,omitempty"` - Leader string `json:"leader,omitempty"` - Replicas []*PeerInfo `json:"replicas,omitempty"` + Name string `json:"name,omitempty"` + RaftGroup string `json:"raft_group,omitempty"` + Leader string `json:"leader,omitempty"` + LeaderSince *time.Time `json:"leader_since,omitempty"` + SystemAcc bool `json:"system_account,omitempty"` + TrafficAcc string `json:"traffic_account,omitempty"` + Replicas []*PeerInfo `json:"replicas,omitempty"` } // PeerInfo shows information about all the peers in the cluster that