Skip to content

Commit

Permalink
Merge pull request #481 from nats-io/neil/observers
Browse files Browse the repository at this point in the history
Add `observer` to peer info
  • Loading branch information
ripienaar authored Feb 20, 2024
2 parents c1d05e6 + e6fda16 commit 16a7ecf
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 5 deletions.
11 changes: 6 additions & 5 deletions api/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ type ClusterInfo struct {
// PeerInfo shows information about all the peers in the cluster that
// are supporting the stream or consumer.
type PeerInfo struct {
Name string `json:"name" yaml:"name"`
Current bool `json:"current" yaml:"current"`
Offline bool `json:"offline,omitempty" yaml:"offline"`
Active time.Duration `json:"active" yaml:"active"`
Lag uint64 `json:"lag,omitempty" yaml:"lag"`
Name string `json:"name" yaml:"name"`
Current bool `json:"current" yaml:"current"`
Observer bool `json:"observer,omitempty" yaml:"observer"`
Offline bool `json:"offline,omitempty" yaml:"offline"`
Active time.Duration `json:"active" yaml:"active"`
Lag uint64 `json:"lag,omitempty" yaml:"lag"`
}
5 changes: 5 additions & 0 deletions schema_source/jetstream/api/v1/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/advisory/v1/consumer_leader_elected.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/advisory/v1/consumer_quorum_lost.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/advisory/v1/stream_leader_elected.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/advisory/v1/stream_quorum_lost.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/consumer_create_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/consumer_info_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/consumer_list_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/stream_create_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/stream_info_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/stream_list_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down
5 changes: 5 additions & 0 deletions schemas/jetstream/api/v1/stream_update_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,11 @@
"type": "boolean",
"default": false
},
"observer": {
"description": "Indicates if the server is running as an observer only",
"type": "boolean",
"default": false
},
"active": {
"description": "Nanoseconds since this peer was last seen",
"type": "number"
Expand Down

0 comments on commit 16a7ecf

Please sign in to comment.