Skip to content

Commit

Permalink
fix(monitor): make the warning and error messages more clear
Browse files Browse the repository at this point in the history
Longhorn 10035

Signed-off-by: Derek Su <[email protected]>
(cherry picked from commit c921e2b)

# Conflicts:
#	controller/monitor/environment_check_monitor.go
  • Loading branch information
derekbit authored and mergify[bot] committed Dec 23, 2024
1 parent baee42f commit 799bdf0
Show file tree
Hide file tree
Showing 2 changed files with 568 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controller/monitor/disk_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ func (m *NodeMonitor) Start() {
}
return false, nil
}); err != nil {
m.logger.WithError(err).Error("Failed to start node monitor")
if errors.Is(err, context.Canceled) {
m.logger.WithError(err).Warning("Disk monitor is stopped")
} else {
m.logger.WithError(err).Error("Failed to start disk monitor")
}
}
}

Expand Down Expand Up @@ -129,6 +133,7 @@ func (m *NodeMonitor) GetCollectedData() (interface{}, error) {
func (m *NodeMonitor) run(value interface{}) error {
node, err := m.ds.GetNode(m.nodeName)
if err != nil {
logrus.WithError(err).Errorf("Failed to get longhorn node %v", m.nodeName)
return errors.Wrapf(err, "failed to get longhorn node %v", m.nodeName)
}

Expand Down
Loading

0 comments on commit 799bdf0

Please sign in to comment.