From 63558a84ad65c52701a5c7af8b45c5d58da542df Mon Sep 17 00:00:00 2001 From: Jerry Leung Date: Fri, 24 May 2024 17:47:47 -0700 Subject: [PATCH] nits --- collector/receiver/telemetryapireceiver/receiver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/receiver/telemetryapireceiver/receiver.go b/collector/receiver/telemetryapireceiver/receiver.go index 87e5623053..00b9cb050b 100644 --- a/collector/receiver/telemetryapireceiver/receiver.go +++ b/collector/receiver/telemetryapireceiver/receiver.go @@ -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