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 disable source output in slowlog #12655
Conversation
When logging large documents via slowlog, setting index.slow_logging.source to false prevents the source from being displayed. Closes #4485
@@ -172,8 +172,10 @@ public static State fromString(String state) { | |||
public static final String SETTING_LEGACY_ROUTING_USE_TYPE = "index.legacy.routing.use_type"; | |||
public static final String SETTING_DATA_PATH = "index.data_path"; | |||
public static final String SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE = "index.shared_filesystem.recover_on_any_node"; | |||
public static final String SETTING_SLOW_LOGGING_SOURCE ="index.slow_logging.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.
Space after the equals. Its a silly small change but it helps my eyes.
@@ -388,6 +392,14 @@ public int getTotalNumberOfShards() { | |||
return totalNumberOfShards(); | |||
} | |||
|
|||
public boolean slowLoggingSource() { |
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.
Do we really need both the getter style and the bare style?
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.
probably not. I copied the style of the other settings
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.
Oh thats cool then. Icky but cool.
I wonder if it'd be possible to make the setting true/false/some_number_of_characters. If the document has more than that many characters then you could just truncate it. You have to figure out truncation in utf-16 unicode characters but I imagine Lucene has a function for that. I like truncating because usually the neat parts of the document are at the front.... On the other hand if this gets any more complicated than it is it'll really need testing. Could you maybe make a constructor for IndexingSlowLog that takes an ESLog as a parameter? Then you could mock it and get the results. Or something like that. |
+1 to making it take an integer instead of a boolean and truncating. Lucene doesn't have utility methods for that, but Java has: we could just read one more UTF16 char if the last one happens to be a high surrogate? |
Ah yes. I remember that. I was thinking about combining codepoints too but
|
I'll take this in a few days if no one else does. |
Obsoleted by #12806. |
When logging large documents via slowlog, setting
index.slow_logging.source
to
false
prevents the source from being displayed.Closes #4485
I don't see any tests for slowlog, so I used these steps to manually test: