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.
This commit revamps the LogActor dramatiq middleware to resolve some issues observed in the logs.
The main changes are:
Instead of prefixing log messages with e.g. "[commit abc123]", put that info into proper fields rendered into our JSON logs, e.g. {"actor": "commit", "publish_id": "abc123", ...}
Include the message ID (which we reuse as task ID). In the case of phase1 commits which can happen multiple times for a single publish, without logging the message ID we can't match up which logs came from which task.
Produce generic start/stop/failed messages for every actor, which also include the actor's duration. Without this there was no clear way to tell when actors started and ended, since most of our actors themselves aren't designed to log that internally.
In the JSON log formatter, just skip any fields which are missing from the log record rather than logging them as null. This is done because the set of fields differ between web & worker, so either we need to use two separate log formats or we just ignore absent fields.