Skip to content

Commit

Permalink
nit: tweak control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nslaughter committed Mar 15, 2024
1 parent d81e6e8 commit 471a959
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/translator/azure/resourcelogs_to_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,11 @@ func (r ResourceLogsUnmarshaler) UnmarshalLogs(buf []byte) (plog.Logs, error) {

for i := 0; i < len(logs); i++ {
log := logs[i]
lr := logRecords.AppendEmpty()
nanos, err := getTimestamp(log)
if err != nil {
r.Logger.Warn("Unable to convert timestamp from log", zap.String("timestamp", log.Time))
}

lr := logRecords.AppendEmpty()
// only set timestamp if the record sent included a valid value
if err == nil {
} else {
lr.SetTimestamp(nanos)
}
// always set observed timestamp to time observed by Collector
Expand Down

0 comments on commit 471a959

Please sign in to comment.