fix: skip loki reporting if streams is empty

This commit is contained in:
Traxmaxx 2025-07-20 13:18:58 +02:00
parent 4040203ff8
commit 8fb9c3cb40
1 changed files with 5 additions and 0 deletions

View File

@ -180,6 +180,11 @@ func (l *Loki) ProcessEvents(report *Report, events *poller.Events) error {
}
logs := report.ProcessEventLogs(events)
if len(logs.Streams) == 0 {
l.LogDebugf("No new events to send to Loki.")
return nil
}
if err := l.client.Post(logs); err != nil {
return fmt.Errorf("sending to Loki failed: %w", err)
}