diff --git a/cns/logger/cnslogger.go b/cns/logger/cnslogger.go index 5289259903..81b91045f3 100644 --- a/cns/logger/cnslogger.go +++ b/cns/logger/cnslogger.go @@ -45,7 +45,12 @@ func New(fileName string, logLevel, logTarget int, logDir string) (loggershim, e if err != nil { l.Errorf("Failed to get zap Platform cores: %v", err) } - zapLogger := zap.New(platformCore, zap.AddCaller()).With(zap.Int("pid", os.Getpid())) + + zapLogger := zap.New( + platformCore, + zap.AddCaller(), + zap.AddStacktrace(zapcore.WarnLevel), + ).With(zap.Int("pid", os.Getpid())) return &logger{ logger: l, diff --git a/cns/restserver/metrics.go b/cns/restserver/metrics.go index b4c0dae8dd..39a472ec57 100644 --- a/cns/restserver/metrics.go +++ b/cns/restserver/metrics.go @@ -219,7 +219,7 @@ func (a *asyncMetricsRecorder) record() { func (service *HTTPRestService) publishIPStateMetrics() { recorder.once.Do(func() { recorder.podIPConfigSrc = service.PodIPConfigStates - recorder.sig = make(chan struct{}) + recorder.sig = make(chan struct{}, 1) go recorder.run() }) select {