More structured logging for Task object #3677
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
also downgrade log message 'Adding a state change event to send' to DEBUG from INFO, since this log message is redundantly logged twice whenever there is a state change, since we also log the state change when we send it to ECS, like this:
level=info time=2023-05-05T22:17:23Z msg="TaskHandler: Adding a state change event to send batched container/managed agent events: arn:aws:ecs:us-west-2:XXX:task/usw2/XXX -> RUNNING, Known Sent: RUNNING, PullStartedAt: 2023-05-05 22:16:44.14108352 +0000 UTC m=+435.253624196, PullStoppedAt: 2023-05-05 22:16:44.3532973 +0000 UTC m=+435.465837967, ExecutionStoppedAt: 0001-01-01 00:00:00 +0000 UTC" module=task_handler.go
level=info time=2023-05-05T22:17:23Z msg="Sending state change to ECS" taskArn="arn:aws:ecs:us-west-2:XXX:task/usw2/XXX" taskStatus="RUNNING" taskReason="" taskPullStartedAt="2023-05-05T22:16:44Z" eventType="TaskStateChange" taskKnownSentStatus="RUNNING" taskPullStoppedAt="2023-05-05T22:16:44Z" taskExecutionStoppedAt="0001-01-01T00:00:00Z" containerChange-0="containerName=nonessential containerStatus=STOPPED containerExitCode=0 containerKnownSentStatus=RUNNING containerRuntimeID=9bd88a86abd927421788d5aae9c4ec95b42b16e6d98a5b43940f084b60a1a91d containerIsEssential=false"
Testing
make release and run
Description for the changelog
NA
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.