The default JSON encoder doesn't omit fields tagged with omitempty if they are not base types, time.Time is a struct so it was getting serialized to CloudWatchLogs which is redundant with the Timestamp field.
I replaced the use of time.Time in the ecslogs.Message.Time field with a ecslogs.Timestamp type which represents a microsecond precision timestamp and can be set to zero so it doesn't get serialized in the CloudWatchLogs events.
Please take a look and let me know if this is good to go!
@segmentio/infra
The default JSON encoder doesn't omit fields tagged with
omitempty
if they are not base types,time.Time
is a struct so it was getting serialized to CloudWatchLogs which is redundant with theTimestamp
field.I replaced the use of
time.Time
in theecslogs.Message.Time
field with aecslogs.Timestamp
type which represents a microsecond precision timestamp and can be set to zero so it doesn't get serialized in the CloudWatchLogs events.Please take a look and let me know if this is good to go!