Skip to content

feat: use named loggers in coderd #8148

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

Merged
merged 8 commits into from
Jun 22, 2023
Merged

feat: use named loggers in coderd #8148

merged 8 commits into from
Jun 22, 2023

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Jun 22, 2023

Related: #6726

This PR modifies logger configuration to use named loggers. The idea is to allow DevOps or admins to configure log alarms (catchphrases) for specific issues:

  • [erro] coderd workspace build error
  • [erro] coderd.autobuild workspace build error
  • [erro] coderd.provisionerd-%s
  • [erro] coderd.userauth
  • [erro] coderd.prometheusmetrics

@mtojek mtojek requested a review from mafredri June 22, 2023 13:07
@mtojek mtojek marked this pull request as ready for review June 22, 2023 13:07
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

It's very possible the additional logger errors are failing tests, typically I believe slogtest fails the test if an error level is logged (unless explicitly ignored when creating slogger).

Other than that, looks fine 👍🏻. Suggestions are optional.

@@ -454,6 +454,10 @@ func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req
}, nil)
var bldErr wsbuilder.BuildError
if xerrors.As(err, &bldErr) {
if bldErr.Status == http.StatusInternalServerError {
Copy link
Member

Choose a reason for hiding this comment

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

Am I the only one that reads this as "boulder"? 😂

@mtojek
Copy link
Member Author

mtojek commented Jun 22, 2023

It's very possible the additional logger errors are failing tests, typically I believe slogtest fails the test if an error level is logged (unless explicitly ignored when creating slogger).

Oh, you're right! I totally forgot about this. I assume that we have to disable this feature of slogtest.

@mtojek mtojek changed the title feat: prepend log prefixes to common Coder errors feat: use named loggers in coderd Jun 22, 2023
@mtojek mtojek changed the title feat: use named loggers in coderd feat: use named loggers in coderd Jun 22, 2023
@mtojek mtojek merged commit 8e2422d into main Jun 22, 2023
@mtojek mtojek deleted the 6726-errors-1 branch June 22, 2023 18:09
@github-actions github-actions bot locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants