-
Notifications
You must be signed in to change notification settings - Fork 25.2k
ES|QL query log #124094
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
ES|QL query log #124094
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
dca56b5
ES|QL slow log
luigidellaquila e725e07
[CI] Auto commit changes from spotless
elasticsearchmachine 4746cd4
Merge branch 'main' into esql/slowlog
luigidellaquila d4ed58f
First round of reviews
luigidellaquila 8957918
Fix test
luigidellaquila 6e0b9c5
Add slowlog for failing queries
luigidellaquila 4d25aaa
Cleanup
luigidellaquila 45764f4
Cleanup
luigidellaquila b2ae5ef
Update docs/changelog/124094.yaml
luigidellaquila 2eb589a
Merge branch 'main' into esql/slowlog
luigidellaquila cbfcf2c
Add unit tests
luigidellaquila 51820c9
Merge remote-tracking branch 'luigidellaquila/esql/slowlog' into esql…
luigidellaquila d2bd672
Add user name to slow log; some refactoring
luigidellaquila b74ea91
Implement review suggestions
luigidellaquila 30d07d4
Merge branch 'main' into esql/slowlog
luigidellaquila 4e1838b
Merge branch 'main' into esql/slowlog
luigidellaquila af3366f
Refactor to use SlowLogFieldProviders
luigidellaquila 95c76d7
Merge remote-tracking branch 'luigidellaquila/esql/slowlog' into esql…
luigidellaquila bbfa89b
[CI] Auto commit changes from spotless
elasticsearchmachine bbc11c5
Merge branch 'main' into esql/slowlog
luigidellaquila e390232
Merge log field providers
luigidellaquila 694ff2e
Merge remote-tracking branch 'luigidellaquila/esql/slowlog' into esql…
luigidellaquila cec182e
[CI] Auto commit changes from spotless
elasticsearchmachine 44ea6fc
Merge branch 'main' into esql/slowlog
luigidellaquila df788db
Fix tests
luigidellaquila a970fc5
Merge remote-tracking branch 'luigidellaquila/esql/slowlog' into esql…
luigidellaquila e4202af
Merge branch 'main' into esql/slowlog
luigidellaquila 01d4c66
Rename as QueryLog
luigidellaquila fd85f06
Simplify cluster settings
luigidellaquila 03dbacd
fix log4j config
luigidellaquila 6cdb1b3
Merge branch 'main' into esql/slowlog
luigidellaquila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pr: 124094 | ||
summary: ES|QL slow log | ||
area: ES|QL | ||
type: enhancement | ||
issues: [] |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
40 changes: 40 additions & 0 deletions
40
.../plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/MockAppender.java
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.esql; | ||
|
||
import org.apache.logging.log4j.core.LogEvent; | ||
import org.apache.logging.log4j.core.appender.AbstractAppender; | ||
import org.apache.logging.log4j.core.filter.RegexFilter; | ||
import org.apache.logging.log4j.message.Message; | ||
|
||
public class MockAppender extends AbstractAppender { | ||
public LogEvent lastEvent; | ||
|
||
public MockAppender(final String name) throws IllegalAccessException { | ||
super(name, RegexFilter.createFilter(".*(\n.*)*", new String[0], false, null, null), null, false); | ||
} | ||
|
||
@Override | ||
public void append(LogEvent event) { | ||
lastEvent = event.toImmutable(); | ||
} | ||
|
||
public Message lastMessage() { | ||
return lastEvent.getMessage(); | ||
} | ||
|
||
public LogEvent lastEvent() { | ||
return lastEvent; | ||
} | ||
|
||
public LogEvent getLastEventAndReset() { | ||
LogEvent toReturn = lastEvent; | ||
lastEvent = null; | ||
return toReturn; | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
The point of this is that it will merge all field providers provided by the plugins into one (in practice I think that's only the one in the security plugin). So this should ideally have an implementation for merging
queryFields
too and then this instance should be passed to thePluginService
(instead of the list of providers).If you don't want to implement the merge for
indexFields
andsearchFields
in the provider without index settings you could add an empty default implementation in the interface in the same way you did forqueryFields
.