Skip to content

Commit

Permalink
Suppress varz jetstream output if not enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Hanel <[email protected]>
  • Loading branch information
matthiashanel committed Mar 15, 2021
1 parent cb93955 commit 2a2adb7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1052,8 +1052,8 @@ type Varz struct {

// JetStreamVarz contains basic runtime information about jetstream
type JetStreamVarz struct {
Config JetStreamConfig `json:"config"`
Stats *JetStreamStats `json:"stats"`
Config *JetStreamConfig `json:"config,omitempty"`
Stats *JetStreamStats `json:"stats,omitempty"`
}

// ClusterOptsVarz contains monitoring cluster information
Expand Down Expand Up @@ -1288,8 +1288,9 @@ func (s *Server) createVarz(pcpu float64, rss int64) *Varz {
}
if s.js != nil {
s.js.mu.RLock()
cfg := s.js.config
varz.JetStream = JetStreamVarz{
Config: s.js.config,
Config: &cfg,
}
s.js.mu.RUnlock()
}
Expand Down

0 comments on commit 2a2adb7

Please sign in to comment.