Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise and improve actor logging #648

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

rohanpm
Copy link
Member

@rohanpm rohanpm commented Dec 12, 2023

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.

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.
@rohanpm rohanpm marked this pull request as ready for review December 13, 2023 19:59
@rohanpm rohanpm merged commit a5e050c into release-engineering:master Dec 14, 2023
3 checks passed
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