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

chore(slo): cleanup error log message #205334

Merged
merged 3 commits into from
Jan 2, 2025

Conversation

kdelemme
Copy link
Contributor

@kdelemme kdelemme commented Dec 31, 2024

Resolves #205355

Summary

This PR audits and rewords the SLO error log message. I've mainly added the original error into the logged message. And changed one log level from error to info

@kdelemme kdelemme added release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.18.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Dec 31, 2024
@kdelemme kdelemme marked this pull request as ready for review December 31, 2024 16:03
@kdelemme kdelemme requested a review from a team as a code owner December 31, 2024 16:03
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@kdelemme kdelemme self-assigned this Dec 31, 2024
Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

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

Overall, LGTM! 🧹 Added a clarification question.

Also, I was wondering if during logging, we can add a field, such as type or something like that, to categories errors. For example, for this error:

Cannot reset the SLO [id: ${slo.id}, revision: ${slo.revision}]. Rolling back. ${err}

it would be useful if we can set a type like reset-slo-failed for grouping errors, do you know if there is such an option?

@@ -100,14 +100,14 @@ export class CreateSLO {
]);
} catch (err) {
this.logger.error(
`Cannot install the SLO [id: ${slo.id}, revision: ${slo.revision}]. Rolling back.`
`Cannot create the SLO [id: ${slo.id}, revision: ${slo.revision}]. Rolling back. ${err}`
Copy link
Member

Choose a reason for hiding this comment

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

Isn't err an object? How would it be logged in this case?
I vaguely remember there was a consideration while logging errors to ensure we don't log sensitive information, do you remember what the issue was and whether it is applicable in this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

in this case, it would be just formatted as error string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it's an object, it will be serialized using its toString() method, which by default includes the name, message and stack trace I believe.

I vaguely remember there was a consideration while logging errors to ensure we don't log sensitive information, do you remember what the issue was and whether it is applicable in this PR?

This was mostly about logging request/response details. In this case, the error message should not include any sensitive information.

@kdelemme kdelemme enabled auto-merge (squash) January 2, 2025 16:43
@kdelemme kdelemme merged commit a0c94f4 into elastic:main Jan 2, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/12586272760

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #54 / Serverless Common UI - Management Index Management Data Streams Modify data streams index mode allows to downgrade data stream from logsdb to standard index mode

Metrics [docs]

✅ unchanged

cc @kdelemme

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 2, 2025
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

cqliu1 pushed a commit to cqliu1/kibana that referenced this pull request Jan 2, 2025
kibanamachine added a commit that referenced this pull request Jan 2, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [chore(slo): cleanup error log message
(#205334)](#205334)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kevin
Delemme","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-02T17:27:26Z","message":"chore(slo):
cleanup error log message
(#205334)","sha":"a0c94f433ac438787b4564750606efd847acfa2c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-management","v8.18.0"],"title":"chore(slo):
cleanup error log
message","number":205334,"url":"https://github.com/elastic/kibana/pull/205334","mergeCommit":{"message":"chore(slo):
cleanup error log message
(#205334)","sha":"a0c94f433ac438787b4564750606efd847acfa2c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205334","number":205334,"mergeCommit":{"message":"chore(slo):
cleanup error log message
(#205334)","sha":"a0c94f433ac438787b4564750606efd847acfa2c"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Kevin Delemme <[email protected]>
@kdelemme kdelemme deleted the chore/slo-logger-errors branch January 3, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SLO] Audit error logs and ensure they match the definition of error category
5 participants