From 41fa8fa2d2458b3d505f5f4fd9cd892a085d7980 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Fri, 19 May 2023 23:36:52 +0800 Subject: [PATCH] fix: increment counter when entry be skipped (#17237) --- internal/logger/target/http/http.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/logger/target/http/http.go b/internal/logger/target/http/http.go index 4b70d8988..e400fc43a 100644 --- a/internal/logger/target/http/http.go +++ b/internal/logger/target/http/http.go @@ -380,6 +380,8 @@ func (h *Target) Send(ctx context.Context, entry interface{}) error { default: // Drop messages until we are online. if !h.IsOnline(ctx) { + atomic.AddInt64(&h.totalMessages, 1) + atomic.AddInt64(&h.failedMessages, 1) return errors.New("log buffer full and remote offline") } nWorkers := atomic.LoadInt64(&h.workers)