Skip to content

Commit 06adbf7

Browse files
committed
improve error messages
1 parent 523f6fd commit 06adbf7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

agent/resources_monitor.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import (
1515
func (a *agent) pushResourcesMonitoring(ctx context.Context, aAPI proto.DRPCAgentClient24) error {
1616
logger := a.logger.Named("resources_monitor")
1717

18-
ctx, cancel := context.WithCancel(ctx)
19-
defer cancel()
20-
2118
clk := quartz.NewReal()
2219

2320
return PushResourcesMonitoringWithConfig(ctx, logger, clk, aAPI.GetResourcesMonitoringConfiguration, aAPI.PushResourcesMonitoringUsage)
@@ -40,7 +37,7 @@ func PushResourcesMonitoringWithConfig(ctx context.Context,
4037
}
4138

4239
if !config.Enabled {
43-
logger.Info(ctx, "resources monitoring is disabled")
40+
logger.Info(ctx, "resources monitoring is disabled - skipping")
4441
return nil
4542
}
4643

@@ -63,7 +60,7 @@ func PushResourcesMonitoringWithConfig(ctx context.Context,
6360
volTotal, volUsed, err := fetchResourceMonitoredVolume(resourcesFetcher, volume)
6461
if err != nil {
6562
logger.Error(ctx, "failed to fetch volume", slog.Error(err))
66-
return nil
63+
continue
6764
}
6865

6966
volumes = append(volumes, &ResourcesMonitorVolumeDatapoint{

0 commit comments

Comments
 (0)