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
Adds a setting to control source output in indexing slowlog #12806
Conversation
@jpountz, this could use a review. |
* high surrogates. | ||
*/ | ||
public static String cleanTruncate(String s, int length) { | ||
if (length > s.length()) { |
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.
s/>/>=/ ?
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.
Yeah - no need to substring in the equals case either.
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.
done
@@ -55,18 +62,27 @@ | |||
public static final String INDEX_INDEXING_SLOWLOG_THRESHOLD_INDEX_TRACE = INDEX_INDEXING_SLOWLOG_PREFIX +".threshold.index.trace"; | |||
public static final String INDEX_INDEXING_SLOWLOG_REFORMAT = INDEX_INDEXING_SLOWLOG_PREFIX +".reformat"; | |||
public static final String INDEX_INDEXING_SLOWLOG_LEVEL = INDEX_INDEXING_SLOWLOG_PREFIX +".level"; | |||
public static final String INDEX_INDEXING_SLOWLOG_MAX_SOURCE_CHARS_TO_LOG = INDEX_INDEXING_SLOWLOG_PREFIX + ".source"; |
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.
maybe also rename the setting? (in addition to the constant)
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.
I kinda like how simple the setting is though. It makes sense because you can set it to false and get no source and true and get it all....
LGTM |
102dfc7
to
b391bfe
Compare
Instead of logging the entire `_source` in the indexing slowlog we log by default just the first 1000 characters - this is controlled by the `index.indexing.slowlog.source` settings and can be set to `true` to log the whole `_source`, `false` to log none of it, and a number to log at most that many characters. Closes elastic#4485
Adds a setting to control source output in indexing slowlog
Instead of logging the entire _source in the indexing slowlog we log by default just the first 1000 characters - this is controlled by the
index.indexing.slowlog.source
settings and can be set totrue
to log the whole _source,false
to log none of it, and a number to log at most that many characters.Closes #4485