Merge pull request #849 from Traxmaxx/fix/missing-loki-stream

fix: skip loki reporting if streams is empty
This commit is contained in:
Cody Lee 2025-08-20 11:18:05 -05:00 committed by GitHub
commit bab01e900b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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)
}