Skip to content

Commit

Permalink
Temporarily mimic previous timestamp functionality (#9221)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored Apr 12, 2022
1 parent 681e98d commit 9a548a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/stanza/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,12 @@ func Convert(ent *entry.Entry) pdata.Logs {

// convertInto converts entry.Entry into provided pdata.LogRecord.
func convertInto(ent *entry.Entry, dest pdata.LogRecord) {
dest.SetTimestamp(pdata.NewTimestampFromTime(ent.Timestamp))
t := ent.ObservedTimestamp
if !ent.Timestamp.IsZero() {
t = ent.Timestamp
}
dest.SetTimestamp(pdata.NewTimestampFromTime(t))

dest.SetSeverityNumber(sevMap[ent.Severity])
dest.SetSeverityText(sevTextMap[ent.Severity])

Expand Down

0 comments on commit 9a548a4

Please sign in to comment.