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

Demote many log lines from info to debug #452

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

brandur
Copy link
Contributor

@brandur brandur commented Jul 13, 2024

We've had reports that a running River client can be quite a noisy
affair, producing too much logging in general.

Here, we move many log lines from info to debug. I suspect the most
impactful is that we had a bunch in the elector and notifier that would
fire quite often during run of the mill operation.

I left a couple in place, although I'm not 100% sure it's the right
thing:

  • The 5 second heartbeat loop in the client that prints job statistics.
    I figure that if this is the main log line being emitted, with
    others being quite rare, it might be okay. We could also consider
    moving it to be more infrequent like every 10 seconds.

  • I left the maintenance service "done run" log lines as info for the
    time being, but I changed them so that they only print in case there
    were >0 results, so I think the result is that most of them are silent
    most of the time, except perhaps in an actual production situation.

I figure we can try this as a pass, see how it is, and then possibly
demote more if it's still annoying.

s.Logger.DebugContext(ctx, s.Name+logPrefixRanSuccessfully,
slog.Int("num_jobs_deleted", res.NumJobsDeleted),
)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some argument to be made that these changes are detrimental to debugging tests, but I generally find that if I'm debugging anything non-trivial I need to add more log statements anyway because the existing ones just aren't enough.

s.Logger.InfoContext(ctx, s.Name+": Rescued batch of jobs",
slog.Int64("num_jobs_discarded", res.NumJobsDiscarded),
slog.Int64("num_jobs_retried", res.NumJobsRetried),
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of these services sort of had doubled up run lines. I took one half out and just left the line above.

We've had reports that a running River client can be quite a noisy
affair, producing too much logging in general.

Here, we move many log lines from info to debug. I suspect the most
impactful is that we had a bunch in the elector and notifier that would
fire quite often during run of the mill operation.

I left a couple in place, although I'm not 100% sure it's the right
thing:

* The 5 second heartbeat loop in the client that prints job statistics.
  I figure that if this is the _main_ log line being emitted, with
  others being quite rare, it might be okay. We could also consider
  moving it to be more infrequent like every 10 seconds.

* I left the maintenance service "done run" log lines as info for the
  time being, but I changed them so that they only print in case there
  were >0 results, so I think the result is that most of them are silent
  most of the time, except perhaps in an actual production situation.

I figure we can try this as a pass, see how it is, and then possibly
demote more if it's still annoying.
@brandur brandur requested a review from bgentry July 13, 2024 05:44
Copy link
Contributor

@bgentry bgentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: 🤫

@brandur
Copy link
Contributor Author

brandur commented Jul 18, 2024

Thanks!

@brandur brandur merged commit 0ed83dd into master Jul 18, 2024
10 checks passed
@brandur brandur deleted the brandur-demote-log-lines branch July 18, 2024 00:02
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