Skip to content

Conversation

massat
Copy link
Contributor

@massat massat commented Aug 31, 2022

Thank you for the awesome tool ❤️

What This PR do?

Remove time.Time fields from the type of input payload of lambda handler function.

Why?

To make it handle payload typed with Task, like results of ECS tasks running on AWS Step Functions.

Context

On AWS Step Functions, I'd like to collect error log from ECS Tasks with tracer deployed as a lambda function.

image

And I got error like below.

{
    "errorMessage": "parsing time \"1661779180572\" as \"\\\"2006-01-02T15:04:05Z07:00\\\"\": cannot parse \"1661779180572\" as \"\\\"\"",
    "errorType": "ParseError"
}

It's because tracer just expects payload from ECS events and tries to handle unixtime fields as RFC3339.

This issue is noted as

The values for the createdAt, connectivityAt, pullStartedAt, startedAt, pullStoppedAt, and updatedAt fields are UNIX timestamps in the response of a DescribeTasks action whereas in the task state change event they are ISO string timestamps.

on ECS events

this patch might be uncool, but I think reasonable because the deleted fields are not referenced.
Thanks!

@fujiwara fujiwara merged commit aaa533b into fujiwara:main Aug 31, 2022
@massat massat deleted the feature/ignore-lambda-timestamp branch August 31, 2022 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants