Skip to content

Commit 245ba2d

Browse files
authored
Merge pull request #1199 from courageJ/cleanup-verbose-logging
Cleanup verbose logging in kubelet monitor
2 parents 87bfbe0 + d988a02 commit 245ba2d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

kubelet-to-gcm/monitor/kubelet/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (s *Source) GetTimeSeriesReq() (*v3.CreateTimeSeriesRequest, error) {
7777
// Translate kubelet's data to GCM v3's format.
7878
tsReq, err := s.translator.Translate(summary)
7979
if err != nil {
80-
return nil, fmt.Errorf("Failed to translate data from summary %v: %v", summary, err)
80+
return nil, fmt.Errorf("Failed to translate data from summary: %v", err)
8181
}
8282

8383
return tsReq, nil

kubelet-to-gcm/monitor/kubelet/translate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ func translateCPU(cpu *stats.CPUStats, tsFactory *timeSeriesFactory, startTime t
433433
return nil, fmt.Errorf("CPU information missing.")
434434
}
435435
if cpu.UsageCoreNanoSeconds == nil {
436-
return nil, fmt.Errorf("UsageCoreNanoSeconds missing from CPUStats %v", cpu)
436+
return nil, fmt.Errorf("UsageCoreNanoSeconds missing from CPUStats")
437437
}
438438
// Only send cpu usage metric if start time is before current time. Right after container is started, kubelet can return start time == end time.
439439
if !cpu.Time.Time.After(startTime) {
@@ -491,7 +491,7 @@ func translateFS(volume string, fs *stats.FsStats, tsFactory *timeSeriesFactory,
491491
}
492492
if diskTotalMD != nil {
493493
if fs.CapacityBytes == nil {
494-
return nil, fmt.Errorf("CapacityBytes is missing from FsStats %v", fs)
494+
return nil, fmt.Errorf("CapacityBytes is missing from FsStats")
495495
}
496496
// Total disk available.
497497
diskTotalPoint := tsFactory.newPoint(&v3.TypedValue{
@@ -503,7 +503,7 @@ func translateFS(volume string, fs *stats.FsStats, tsFactory *timeSeriesFactory,
503503

504504
if diskUsedMD != nil {
505505
if fs.UsedBytes == nil {
506-
return nil, fmt.Errorf("UsedBytes is missing from FsStats %v", fs)
506+
return nil, fmt.Errorf("UsedBytes is missing from FsStats")
507507
}
508508
// Total disk used.
509509
diskUsedPoint := tsFactory.newPoint(&v3.TypedValue{
@@ -545,7 +545,7 @@ func translateMemory(memory *stats.MemoryStats, tsFactory *timeSeriesFactory, st
545545

546546
if memUsedMD != nil {
547547
if memory.WorkingSetBytes == nil {
548-
return nil, fmt.Errorf("WorkingSetBytes information missing in MemoryStats %v", memory)
548+
return nil, fmt.Errorf("WorkingSetBytes information missing in MemoryStats")
549549
}
550550
// Non-evictable memory.
551551
nonEvictMemPoint := tsFactory.newPoint(&v3.TypedValue{

0 commit comments

Comments
 (0)