Skip to content

Commit

Permalink
Merge pull request #2009 from nats-io/js-disabled-varz
Browse files Browse the repository at this point in the history
Suppress varz jetstream output if not enabled
  • Loading branch information
matthiashanel authored Mar 15, 2021
2 parents cb93955 + 2a2adb7 commit d7403ea
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 d7403ea

Please sign in to comment.