fix: increment counter when entry be skipped (#17237)

This commit is contained in:
jiuker 2023-05-19 23:36:52 +08:00 committed by GitHub
parent e94e6adf91
commit 41fa8fa2d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)