Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrytfleung committed May 25, 2024
1 parent bd5dd05 commit 63558a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions collector/receiver/telemetryapireceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ func (r *telemetryAPIReceiver) createLogs(slice []event) (plog.Logs, error) {
if record, ok := el.Record.(map[string]interface{}); ok {
// in JSON format https://docs.aws.amazon.com/lambda/latest/dg/telemetry-schema-reference.html#telemetry-api-function
if timestamp, ok := record["timestamp"].(string); ok {
if observedTime, err := time.Parse(timeFormatLayout, timestamp); err == nil {
logRecord.SetTimestamp(pcommon.NewTimestampFromTime(observedTime))
if t, err := time.Parse(timeFormatLayout, timestamp); err == nil {
logRecord.SetTimestamp(pcommon.NewTimestampFromTime(t))
} else {
r.logger.Error("error parsing time", zap.Error(err))
return plog.Logs{}, err
Expand Down

0 comments on commit 63558a8

Please sign in to comment.