Skip to content
Prev Previous commit
Next Next commit
fixup! more debug logging
  • Loading branch information
coadler committed Jul 20, 2023
commit 4b08319cb6b046072f29bd522985d36d12b1bc50
3 changes: 3 additions & 0 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ func (a *agent) reportMetadataLoop(ctx context.Context) {
case <-ctx.Done():
return
case mr := <-metadataResults:
lastCollectedAtMu.Lock()
lastCollectedAts[mr.key] = mr.result.CollectedAt
lastCollectedAtMu.Unlock()
err := a.client.PostMetadata(ctx, mr.key, *mr.result)
if err != nil {
a.logger.Error(ctx, "agent failed to report metadata", slog.Error(err))
Expand Down Expand Up @@ -439,6 +441,7 @@ func (a *agent) reportMetadataLoop(ctx context.Context) {
key: md.Key,
result: a.collectMetadata(ctx, md),
}:
logger.Debug(ctx, "sent metadata")
}
})
}
Expand Down