[Issue #1578] Setup adding task information to all task logs #2196
+222
−17
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.
Summary
Fixes #1578
Time to review: 10 mins
Changes proposed
Add a decorator method you can add to an ECS task entry function that automatically logs basic info about the environment, app, and AWS setup
Context for reviewers
This makes it so you can setup the app (running as an API or standalone script for an ECS task) to automatically include some general log info. In this case, the app name, environment, and the task name. Once we're running more consistently on ECS, it should also include some AWS info, although that needs to be tested still.
When we get proper log ingestion into New Relic, this will make searching for things much easier (eg. filter to all logs from a specific job type, or specific run) which can greatly aid in debugging.
Additional information
For example, using the
export-opportunity-data
task as an example, the logs change from:to