Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: provisionerd: add more context to logs emitted, fix log level#6508

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 4 commits intomainfromcj/provisionerd-log-improvements
Mar 8, 2023

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedMar 8, 2023
edited
Loading

  • Previously, we were logging all provision response logs at level INFO, regardless of the log level of the log streamed from the provisioner. We now log these at the original level (ERROR or WARN, defaulting to INFO).
  • Now logging "provision failed" message at levelERROR WARN and including theerror field in the message.

@johnstcnjohnstcn self-assigned thisMar 8, 2023
@johnstcnjohnstcn marked this pull request as ready for reviewMarch 8, 2023 14:27
@@ -895,8 +895,9 @@ func (r *Runner) buildWorkspace(ctx context.Context, stage string, req *sdkproto
})
case *sdkproto.Provision_Response_Complete:
if msgType.Complete.Error != "" {
r.logger.Info(context.Background(), "provision failed; updating state",
r.logger.Warn(context.Background(), "provision failed; updating state",
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

note: logging at level ERROR breaks existing unit tests, and I don't want to setslogtest.IgnoreErrors.

Copy link
Member

Choose a reason for hiding this comment

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

Understandable. It might be the "correct" approach though, if we expect errors to be logged, then setting IgnoreErrors seems like the right course of action.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@mafredri Would you agree that anything "ERROR" and above should be mainly for events useful to a system administrator?

Copy link
Member

Choose a reason for hiding this comment

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

Could be relevant for e.g. template authors, but generally I doubt coder/provisioner logs (via logger) would be surfaced to anyone but systems admins.

case sdkproto.LogLevel_ERROR:
r.logger.Error(ctx, msg, fields...)
default: // should never happen, but we should not explode either.
r.logger.Info(ctx, msg, fields...)
Copy link
Member

Choose a reason for hiding this comment

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

In theory, it could be possible that a customer misconfigures the Coder deployment, INFO will be selected as default logging level, and it can blow up the cluster if there are thousands of logs, but that's just theory.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

INFO is the status quo, and the only way for someone to select a different level is to setCODER_VERBOSE or--verbose, both of which need to be set explicitly.

@johnstcnjohnstcn merged commit26a725f intomainMar 8, 2023
@johnstcnjohnstcn deleted the cj/provisionerd-log-improvements branchMarch 8, 2023 15:12
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 8, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@mtojekmtojekmtojek approved these changes

@coadlercoadlerAwaiting requested review from coadler

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp