-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Skip stacktrace for exceptions when stacktrace is not relevant. #110785
Merged
mosche
merged 4 commits into
elastic:main
from
mosche:ES-7097_skip_stacktrace_if_irrelevant
Jul 12, 2024
Merged
Skip stacktrace for exceptions when stacktrace is not relevant. #110785
mosche
merged 4 commits into
elastic:main
from
mosche:ES-7097_skip_stacktrace_if_irrelevant
Jul 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These exceptions are expected and don't imply bugs, their stacktrace isn't relevant and should not be logged. Relates to ES-7097
Pinging @elastic/es-core-infra (Team:Core/Infra) |
thecoop
approved these changes
Jul 11, 2024
pgomulka
reviewed
Jul 12, 2024
@@ -27,4 +27,9 @@ public NodeNotConnectedException(DiscoveryNode node, String msg) { | |||
public NodeNotConnectedException(StreamInput in) throws IOException { | |||
super(in); | |||
} | |||
|
|||
@Override | |||
public Throwable fillInStackTrace() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to have a common abstract 'nonprintable exception' class?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Core/Infra/Core
Core issues without another label
:Core/Infra/Logging
Log management and logging utilities
>non-issue
Team:Core/Infra
Meta label for core/infra team
v8.16.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed last week, in order to improve error logging this PR skips the creation of stacktraces for a number of common and expected exceptions where there's no value having one.
Despite having no (meaningful) stacktrace, the exceptions are nevertheless good to be aware of as they may signal (in)stability.
They could be filtered out from logs and be monitored using APM metrics only. However, that would likely hurt discoverability and break existing flows of devs when investigating issues.
If only removing (costly) stacktraces when not relevant, we will be able to continue aggregating all exceptions by means of
error.type
.Note:
EcsJsonLayout
usesprintStackTrace
, this wayerror.stack_trace
will still exist containing the output of the exception'stoString()
. This PR omiterror.stack_trace
entirely in that case.Relates to ES-7097