diff --git a/server/src/main/java/org/elasticsearch/index/SlowLogFieldProvider.java b/server/src/main/java/org/elasticsearch/index/ActionLogFieldProvider.java similarity index 79% rename from server/src/main/java/org/elasticsearch/index/SlowLogFieldProvider.java rename to server/src/main/java/org/elasticsearch/index/ActionLogFieldProvider.java index dfab7e1d11e34..d957cdccfbe3a 100644 --- a/server/src/main/java/org/elasticsearch/index/SlowLogFieldProvider.java +++ b/server/src/main/java/org/elasticsearch/index/ActionLogFieldProvider.java @@ -10,18 +10,18 @@ package org.elasticsearch.index; /** - * Interface for providing additional fields to the slow log from a plugin. + * Interface for providing additional fields to the action log from a plugin. * Intended to be loaded through SPI. */ -public interface SlowLogFieldProvider { +public interface ActionLogFieldProvider { /** * Create a field provider with index level settings to be able to listen for updates and set initial values * @param indexSettings settings for the index */ - SlowLogFields create(IndexSettings indexSettings); + ActionLogFields create(IndexSettings indexSettings); /** * Create a field provider without index level settings */ - SlowLogFields create(); + ActionLogFields create(); } diff --git a/server/src/main/java/org/elasticsearch/index/SlowLogFields.java b/server/src/main/java/org/elasticsearch/index/ActionLogFields.java similarity index 77% rename from server/src/main/java/org/elasticsearch/index/SlowLogFields.java rename to server/src/main/java/org/elasticsearch/index/ActionLogFields.java index b0d5ebd5cea81..600883aa704d5 100644 --- a/server/src/main/java/org/elasticsearch/index/SlowLogFields.java +++ b/server/src/main/java/org/elasticsearch/index/ActionLogFields.java @@ -12,24 +12,24 @@ import java.util.Map; /** - * Fields for the slow log. These may be different each call depending on the state of the system. + * Fields for the action log. These may be different each call depending on the state of the system. */ -public interface SlowLogFields { +public interface ActionLogFields { /** - * Slow log fields for indexing events + * Log fields for indexing events * @return map of field name to value */ Map indexFields(); /** - * Slow log fields for search events + * Log fields for search events * @return map of field name to value */ Map searchFields(); /** - * Slow log fields for query + * Log fields for query * @return map of field name to value */ default Map queryFields() { diff --git a/server/src/main/java/org/elasticsearch/index/IndexModule.java b/server/src/main/java/org/elasticsearch/index/IndexModule.java index 7f7f3cd5e59f9..f7de5d68ea599 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexModule.java +++ b/server/src/main/java/org/elasticsearch/index/IndexModule.java @@ -202,7 +202,7 @@ public IndexModule( final BooleanSupplier allowExpensiveQueries, final IndexNameExpressionResolver expressionResolver, final Map recoveryStateFactories, - final SlowLogFieldProvider slowLogFieldProvider, + final ActionLogFieldProvider slowLogFieldProvider, final MapperMetrics mapperMetrics, final List searchOperationListeners, final IndexingStatsSettings indexingStatsSettings, @@ -214,9 +214,9 @@ public IndexModule( this.engineFactory = Objects.requireNonNull(engineFactory); // Need to have a mutable arraylist for plugins to add listeners to it this.searchOperationListeners = new ArrayList<>(searchOperationListeners); - SlowLogFields slowLogFields = slowLogFieldProvider.create(indexSettings); - this.searchOperationListeners.add(new SearchSlowLog(indexSettings, slowLogFields)); - this.indexOperationListeners.add(new IndexingSlowLog(indexSettings, slowLogFields)); + ActionLogFields actionLogFields = slowLogFieldProvider.create(indexSettings); + this.searchOperationListeners.add(new SearchSlowLog(indexSettings, actionLogFields)); + this.indexOperationListeners.add(new IndexingSlowLog(indexSettings, actionLogFields)); this.directoryFactories = Collections.unmodifiableMap(directoryFactories); this.allowExpensiveQueries = allowExpensiveQueries; this.expressionResolver = expressionResolver; diff --git a/server/src/main/java/org/elasticsearch/index/IndexingSlowLog.java b/server/src/main/java/org/elasticsearch/index/IndexingSlowLog.java index b39cc11847cca..111c9b891854d 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexingSlowLog.java +++ b/server/src/main/java/org/elasticsearch/index/IndexingSlowLog.java @@ -103,7 +103,7 @@ public final class IndexingSlowLog implements IndexingOperationListener { * characters of the source. */ private int maxSourceCharsToLog; - private final SlowLogFields slowLogFields; + private final ActionLogFields slowLogFields; /** * Reads how much of the source to log. The user can specify any value they @@ -125,7 +125,7 @@ public final class IndexingSlowLog implements IndexingOperationListener { Property.IndexScope ); - IndexingSlowLog(IndexSettings indexSettings, SlowLogFields slowLogFields) { + IndexingSlowLog(IndexSettings indexSettings, ActionLogFields slowLogFields) { this.slowLogFields = slowLogFields; this.index = indexSettings.getIndex(); diff --git a/server/src/main/java/org/elasticsearch/index/SearchSlowLog.java b/server/src/main/java/org/elasticsearch/index/SearchSlowLog.java index d32b9f8e5ad63..9c7af574543fd 100644 --- a/server/src/main/java/org/elasticsearch/index/SearchSlowLog.java +++ b/server/src/main/java/org/elasticsearch/index/SearchSlowLog.java @@ -45,7 +45,7 @@ public final class SearchSlowLog implements SearchOperationListener { private static final Logger queryLogger = LogManager.getLogger(INDEX_SEARCH_SLOWLOG_PREFIX + ".query"); private static final Logger fetchLogger = LogManager.getLogger(INDEX_SEARCH_SLOWLOG_PREFIX + ".fetch"); - private final SlowLogFields slowLogFields; + private final ActionLogFields slowLogFields; public static final Setting INDEX_SEARCH_SLOWLOG_INCLUDE_USER_SETTING = Setting.boolSetting( INDEX_SEARCH_SLOWLOG_PREFIX + ".include.user", @@ -126,7 +126,7 @@ public final class SearchSlowLog implements SearchOperationListener { private static final ToXContent.Params FORMAT_PARAMS = new ToXContent.MapParams(Collections.singletonMap("pretty", "false")); - public SearchSlowLog(IndexSettings indexSettings, SlowLogFields slowLogFields) { + public SearchSlowLog(IndexSettings indexSettings, ActionLogFields slowLogFields) { this.slowLogFields = slowLogFields; indexSettings.getScopedSettings() .addSettingsUpdateConsumer(INDEX_SEARCH_SLOWLOG_THRESHOLD_QUERY_WARN_SETTING, this::setQueryWarnThreshold); diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesService.java b/server/src/main/java/org/elasticsearch/indices/IndicesService.java index 1cfe81909475f..a2c876fdbed81 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -85,6 +85,7 @@ import org.elasticsearch.env.ShardLockObtainFailedException; import org.elasticsearch.gateway.MetaStateService; import org.elasticsearch.gateway.MetadataStateFormat; +import org.elasticsearch.index.ActionLogFieldProvider; import org.elasticsearch.index.CloseUtils; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexMode; @@ -92,7 +93,6 @@ import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.SlowLogFieldProvider; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.index.bulk.stats.BulkStats; import org.elasticsearch.index.cache.request.ShardRequestCache; @@ -284,7 +284,7 @@ public class IndicesService extends AbstractLifecycleComponent private final PostRecoveryMerger postRecoveryMerger; private final List searchOperationListeners; private final QueryRewriteInterceptor queryRewriteInterceptor; - final SlowLogFieldProvider slowLogFieldProvider; // pkg-private for testingå + final ActionLogFieldProvider actionLogFieldProvider; // pkg-private for testingå private final IndexingStatsSettings indexStatsSettings; private final SearchStatsSettings searchStatsSettings; private final MergeMetrics mergeMetrics; @@ -414,7 +414,7 @@ public void onRemoval(ShardId shardId, String fieldName, boolean wasEvicted, lon this.timestampFieldMapperService = new TimestampFieldMapperService(settings, threadPool, this); this.postRecoveryMerger = new PostRecoveryMerger(settings, threadPool.executor(ThreadPool.Names.FORCE_MERGE), this::getShardOrNull); this.searchOperationListeners = builder.searchOperationListener; - this.slowLogFieldProvider = builder.slowLogFieldProvider; + this.actionLogFieldProvider = builder.slowLogFieldProvider; this.indexStatsSettings = new IndexingStatsSettings(clusterService.getClusterSettings()); this.searchStatsSettings = new SearchStatsSettings(clusterService.getClusterSettings()); } @@ -810,7 +810,7 @@ private synchronized IndexService createIndexService( () -> allowExpensiveQueries, indexNameExpressionResolver, recoveryStateFactories, - slowLogFieldProvider, + actionLogFieldProvider, mapperMetrics, searchOperationListeners, indexStatsSettings, @@ -909,7 +909,7 @@ public synchronized MapperService createIndexMapperServiceForValidation(IndexMet () -> allowExpensiveQueries, indexNameExpressionResolver, recoveryStateFactories, - slowLogFieldProvider, + actionLogFieldProvider, mapperMetrics, searchOperationListeners, indexStatsSettings, diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesServiceBuilder.java b/server/src/main/java/org/elasticsearch/indices/IndicesServiceBuilder.java index 3b7f4d24869f2..5adc29e951b8b 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesServiceBuilder.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesServiceBuilder.java @@ -22,9 +22,9 @@ import org.elasticsearch.core.Nullable; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.gateway.MetaStateService; +import org.elasticsearch.index.ActionLogFieldProvider; +import org.elasticsearch.index.ActionLogFields; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.SlowLogFieldProvider; -import org.elasticsearch.index.SlowLogFields; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.index.engine.EngineFactory; import org.elasticsearch.index.engine.MergeMetrics; @@ -83,10 +83,10 @@ public class IndicesServiceBuilder { MergeMetrics mergeMetrics; List searchOperationListener = List.of(); QueryRewriteInterceptor queryRewriteInterceptor = null; - SlowLogFieldProvider slowLogFieldProvider = new SlowLogFieldProvider() { + ActionLogFieldProvider slowLogFieldProvider = new ActionLogFieldProvider() { @Override - public SlowLogFields create() { - return new SlowLogFields() { + public ActionLogFields create() { + return new ActionLogFields() { @Override public Map indexFields() { return Map.of(); @@ -100,7 +100,7 @@ public Map searchFields() { } @Override - public SlowLogFields create(IndexSettings indexSettings) { + public ActionLogFields create(IndexSettings indexSettings) { return create(); } @@ -222,8 +222,8 @@ public IndicesServiceBuilder searchOperationListeners(List slowLogFieldProviders = pluginsService.loadServiceProviders(SlowLogFieldProvider.class); + List slowLogFieldProviders = pluginsService.loadServiceProviders(ActionLogFieldProvider.class); // NOTE: the response of index/search slow log fields below must be calculated dynamically on every call // because the responses may change dynamically at runtime - SlowLogFieldProvider slowLogFieldProvider = new SlowLogFieldProvider() { - public SlowLogFields create() { - final List fields = new ArrayList<>(); + ActionLogFieldProvider actionLogFieldProvider = new ActionLogFieldProvider() { + public ActionLogFields create() { + final List fields = new ArrayList<>(); for (var provider : slowLogFieldProviders) { fields.add(provider.create()); } - return new SlowLogFields() { + return new ActionLogFields() { @Override public Map indexFields() { return fields.stream() @@ -901,12 +901,12 @@ public Map queryFields() { }; } - public SlowLogFields create(IndexSettings indexSettings) { - final List fields = new ArrayList<>(); + public ActionLogFields create(IndexSettings indexSettings) { + final List fields = new ArrayList<>(); for (var provider : slowLogFieldProviders) { fields.add(provider.create(indexSettings)); } - return new SlowLogFields() { + return new ActionLogFields() { @Override public Map indexFields() { return fields.stream() @@ -954,7 +954,7 @@ public Map queryFields() { .mapperMetrics(mapperMetrics) .mergeMetrics(mergeMetrics) .searchOperationListeners(searchOperationListeners) - .slowLogFieldProvider(slowLogFieldProvider) + .slowLogFieldProvider(actionLogFieldProvider) .build(); final var parameters = new IndexSettingProvider.Parameters(clusterService, indicesService::createIndexMapperServiceForValidation); @@ -1046,7 +1046,7 @@ public Map queryFields() { documentParsingProvider, taskManager, projectResolver, - slowLogFieldProvider, + actionLogFieldProvider, indexingLimits, linkedProjectConfigService, projectRoutingResolver diff --git a/server/src/main/java/org/elasticsearch/node/PluginServiceInstances.java b/server/src/main/java/org/elasticsearch/node/PluginServiceInstances.java index 24c787220f7eb..148e2de90579d 100644 --- a/server/src/main/java/org/elasticsearch/node/PluginServiceInstances.java +++ b/server/src/main/java/org/elasticsearch/node/PluginServiceInstances.java @@ -20,8 +20,8 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.features.FeatureService; +import org.elasticsearch.index.ActionLogFieldProvider; import org.elasticsearch.index.IndexingPressure; -import org.elasticsearch.index.SlowLogFieldProvider; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.SystemIndices; import org.elasticsearch.plugins.Plugin; @@ -58,7 +58,7 @@ public record PluginServiceInstances( DocumentParsingProvider documentParsingProvider, TaskManager taskManager, ProjectResolver projectResolver, - SlowLogFieldProvider slowLogFieldProvider, + ActionLogFieldProvider actionLogFieldProvider, IndexingPressure indexingPressure, LinkedProjectConfigService linkedProjectConfigService, ProjectRoutingResolver projectRoutingResolver diff --git a/server/src/main/java/org/elasticsearch/plugins/Plugin.java b/server/src/main/java/org/elasticsearch/plugins/Plugin.java index f4b1647dc30ed..e632108076bff 100644 --- a/server/src/main/java/org/elasticsearch/plugins/Plugin.java +++ b/server/src/main/java/org/elasticsearch/plugins/Plugin.java @@ -27,10 +27,10 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.features.FeatureService; +import org.elasticsearch.index.ActionLogFieldProvider; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexSettingProvider; import org.elasticsearch.index.IndexingPressure; -import org.elasticsearch.index.SlowLogFieldProvider; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.SystemIndices; import org.elasticsearch.plugins.internal.DocumentParsingProvider; @@ -188,7 +188,7 @@ public interface PluginServices { /** * Provider for additional SlowLog fields */ - SlowLogFieldProvider slowLogFieldProvider(); + ActionLogFieldProvider actionLogFieldProvider(); /** * Provider for indexing pressure diff --git a/server/src/test/java/org/elasticsearch/index/IndexModuleTests.java b/server/src/test/java/org/elasticsearch/index/IndexModuleTests.java index 145e2abbc1902..04a0ab6a3283a 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexModuleTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexModuleTests.java @@ -258,7 +258,7 @@ public void testWrapperIsBound() throws IOException { () -> true, indexNameExpressionResolver, Collections.emptyMap(), - mock(SlowLogFieldProvider.class), + mock(ActionLogFieldProvider.class), MapperMetrics.NOOP, emptyList(), new IndexingStatsSettings(ClusterSettings.createBuiltInClusterSettings()), @@ -289,7 +289,7 @@ public void testRegisterIndexStore() throws IOException { () -> true, indexNameExpressionResolver, Collections.emptyMap(), - mock(SlowLogFieldProvider.class), + mock(ActionLogFieldProvider.class), MapperMetrics.NOOP, emptyList(), new IndexingStatsSettings(ClusterSettings.createBuiltInClusterSettings()), @@ -318,7 +318,7 @@ public void testDirectoryWrapper() throws IOException { () -> true, indexNameExpressionResolver, Collections.emptyMap(), - mock(SlowLogFieldProvider.class), + mock(ActionLogFieldProvider.class), MapperMetrics.NOOP, emptyList(), new IndexingStatsSettings(ClusterSettings.createBuiltInClusterSettings()), @@ -675,7 +675,7 @@ public void testRegisterCustomRecoveryStateFactory() throws IOException { () -> true, indexNameExpressionResolver, recoveryStateFactories, - mock(SlowLogFieldProvider.class), + mock(ActionLogFieldProvider.class), MapperMetrics.NOOP, emptyList(), new IndexingStatsSettings(ClusterSettings.createBuiltInClusterSettings()), @@ -701,7 +701,7 @@ public void testIndexCommitListenerIsBound() throws IOException, ExecutionExcept () -> true, indexNameExpressionResolver, Collections.emptyMap(), - mock(SlowLogFieldProvider.class), + mock(ActionLogFieldProvider.class), MapperMetrics.NOOP, emptyList(), new IndexingStatsSettings(ClusterSettings.createBuiltInClusterSettings()), @@ -807,7 +807,7 @@ private static IndexModule createIndexModule( () -> true, indexNameExpressionResolver, Collections.emptyMap(), - mock(SlowLogFieldProvider.class), + mock(ActionLogFieldProvider.class), MapperMetrics.NOOP, emptyList(), new IndexingStatsSettings(ClusterSettings.createBuiltInClusterSettings()), diff --git a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java index a08029c7fb3b4..0fe76ffa3bb9e 100644 --- a/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java +++ b/server/src/test/java/org/elasticsearch/index/IndexingSlowLogTests.java @@ -81,7 +81,7 @@ public void testLevelPrecedence() { String uuid = UUIDs.randomBase64UUID(); IndexMetadata metadata = createIndexMetadata("index-precedence", settings(uuid)); IndexSettings settings = new IndexSettings(metadata, Settings.EMPTY); - IndexingSlowLog log = new IndexingSlowLog(settings, mock(SlowLogFields.class)); + IndexingSlowLog log = new IndexingSlowLog(settings, mock(ActionLogFields.class)); ParsedDocument doc = EngineTestCase.createParsedDoc("1", null); Engine.Index index = new Engine.Index(Uid.encodeId("doc_id"), randomNonNegativeLong(), doc); @@ -142,7 +142,7 @@ public void testTwoLoggersDifferentLevel() { ), Settings.EMPTY ); - IndexingSlowLog log1 = new IndexingSlowLog(index1Settings, mock(SlowLogFields.class)); + IndexingSlowLog log1 = new IndexingSlowLog(index1Settings, mock(ActionLogFields.class)); IndexSettings index2Settings = new IndexSettings( createIndexMetadata( @@ -155,7 +155,7 @@ public void testTwoLoggersDifferentLevel() { ), Settings.EMPTY ); - IndexingSlowLog log2 = new IndexingSlowLog(index2Settings, mock(SlowLogFields.class)); + IndexingSlowLog log2 = new IndexingSlowLog(index2Settings, mock(ActionLogFields.class)); ParsedDocument doc = EngineTestCase.createParsedDoc("1", null); Engine.Index index = new Engine.Index(Uid.encodeId("doc_id"), randomNonNegativeLong(), doc); @@ -179,12 +179,12 @@ public void testMultipleSlowLoggersUseSingleLog4jLogger() { LoggerContext context = (LoggerContext) LogManager.getContext(false); IndexSettings index1Settings = new IndexSettings(createIndexMetadata("index1", settings(UUIDs.randomBase64UUID())), Settings.EMPTY); - IndexingSlowLog log1 = new IndexingSlowLog(index1Settings, mock(SlowLogFields.class)); + IndexingSlowLog log1 = new IndexingSlowLog(index1Settings, mock(ActionLogFields.class)); int numberOfLoggersBefore = context.getLoggers().size(); IndexSettings index2Settings = new IndexSettings(createIndexMetadata("index2", settings(UUIDs.randomBase64UUID())), Settings.EMPTY); - IndexingSlowLog log2 = new IndexingSlowLog(index2Settings, mock(SlowLogFields.class)); + IndexingSlowLog log2 = new IndexingSlowLog(index2Settings, mock(ActionLogFields.class)); context = (LoggerContext) LogManager.getContext(false); int numberOfLoggersAfter = context.getLoggers().size(); @@ -355,7 +355,7 @@ public void testReformatSetting() { .build() ); IndexSettings settings = new IndexSettings(metadata, Settings.EMPTY); - IndexingSlowLog log = new IndexingSlowLog(settings, mock(SlowLogFields.class)); + IndexingSlowLog log = new IndexingSlowLog(settings, mock(ActionLogFields.class)); assertFalse(log.isReformat()); settings.updateIndexMetadata( newIndexMeta("index", Settings.builder().put(IndexingSlowLog.INDEX_INDEXING_SLOWLOG_REFORMAT_SETTING.getKey(), "true").build()) @@ -372,7 +372,7 @@ public void testReformatSetting() { metadata = newIndexMeta("index", Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current()).build()); settings = new IndexSettings(metadata, Settings.EMPTY); - log = new IndexingSlowLog(settings, mock(SlowLogFields.class)); + log = new IndexingSlowLog(settings, mock(ActionLogFields.class)); assertTrue(log.isReformat()); try { settings.updateIndexMetadata( @@ -405,7 +405,7 @@ public void testSetLevels() { .build() ); IndexSettings settings = new IndexSettings(metadata, Settings.EMPTY); - IndexingSlowLog log = new IndexingSlowLog(settings, mock(SlowLogFields.class)); + IndexingSlowLog log = new IndexingSlowLog(settings, mock(ActionLogFields.class)); assertEquals(TimeValue.timeValueMillis(100).nanos(), log.getIndexTraceThreshold()); assertEquals(TimeValue.timeValueMillis(200).nanos(), log.getIndexDebugThreshold()); assertEquals(TimeValue.timeValueMillis(300).nanos(), log.getIndexInfoThreshold()); @@ -436,7 +436,7 @@ public void testSetLevels() { assertEquals(TimeValue.MINUS_ONE.nanos(), log.getIndexWarnThreshold()); settings = new IndexSettings(metadata, Settings.EMPTY); - log = new IndexingSlowLog(settings, mock(SlowLogFields.class)); + log = new IndexingSlowLog(settings, mock(ActionLogFields.class)); assertEquals(TimeValue.MINUS_ONE.nanos(), log.getIndexTraceThreshold()); assertEquals(TimeValue.MINUS_ONE.nanos(), log.getIndexDebugThreshold()); diff --git a/server/src/test/java/org/elasticsearch/index/SearchSlowLogTests.java b/server/src/test/java/org/elasticsearch/index/SearchSlowLogTests.java index a7596cc8342f8..e00c56cdcfb23 100644 --- a/server/src/test/java/org/elasticsearch/index/SearchSlowLogTests.java +++ b/server/src/test/java/org/elasticsearch/index/SearchSlowLogTests.java @@ -104,7 +104,7 @@ public void testLevelPrecedence() { try (SearchContext ctx = searchContextWithSourceAndTask(createIndex("index"))) { String uuid = UUIDs.randomBase64UUID(); IndexSettings settings = new IndexSettings(createIndexMetadata("index", settings(uuid)), Settings.EMPTY); - SearchSlowLog log = new SearchSlowLog(settings, mock(SlowLogFields.class)); + SearchSlowLog log = new SearchSlowLog(settings, mock(ActionLogFields.class)); // For this test, when level is not breached, the level below should be used. { @@ -188,7 +188,7 @@ public void testTwoLoggersDifferentLevel() { ), Settings.EMPTY ); - SearchSlowLog log1 = new SearchSlowLog(settings1, mock(SlowLogFields.class)); + SearchSlowLog log1 = new SearchSlowLog(settings1, mock(ActionLogFields.class)); IndexSettings settings2 = new IndexSettings( createIndexMetadata( @@ -201,7 +201,7 @@ public void testTwoLoggersDifferentLevel() { ), Settings.EMPTY ); - SearchSlowLog log2 = new SearchSlowLog(settings2, mock(SlowLogFields.class)); + SearchSlowLog log2 = new SearchSlowLog(settings2, mock(ActionLogFields.class)); { // threshold set on WARN only, should not log @@ -224,7 +224,7 @@ public void testMultipleSlowLoggersUseSingleLog4jLogger() { try (SearchContext ctx1 = searchContextWithSourceAndTask(createIndex("index-1"))) { IndexSettings settings1 = new IndexSettings(createIndexMetadata("index-1", settings(UUIDs.randomBase64UUID())), Settings.EMPTY); - SearchSlowLog log1 = new SearchSlowLog(settings1, mock(SlowLogFields.class)); + SearchSlowLog log1 = new SearchSlowLog(settings1, mock(ActionLogFields.class)); int numberOfLoggersBefore = context.getLoggers().size(); try (SearchContext ctx2 = searchContextWithSourceAndTask(createIndex("index-2"))) { @@ -232,7 +232,7 @@ public void testMultipleSlowLoggersUseSingleLog4jLogger() { createIndexMetadata("index-2", settings(UUIDs.randomBase64UUID())), Settings.EMPTY ); - SearchSlowLog log2 = new SearchSlowLog(settings2, mock(SlowLogFields.class)); + SearchSlowLog log2 = new SearchSlowLog(settings2, mock(ActionLogFields.class)); int numberOfLoggersAfter = context.getLoggers().size(); assertThat(numberOfLoggersAfter, equalTo(numberOfLoggersBefore)); @@ -324,7 +324,7 @@ public void testSetQueryLevels() { .build() ); IndexSettings settings = new IndexSettings(metadata, Settings.EMPTY); - SearchSlowLog log = new SearchSlowLog(settings, mock(SlowLogFields.class)); + SearchSlowLog log = new SearchSlowLog(settings, mock(ActionLogFields.class)); assertEquals(TimeValue.timeValueMillis(100).nanos(), log.getQueryTraceThreshold()); assertEquals(TimeValue.timeValueMillis(200).nanos(), log.getQueryDebugThreshold()); assertEquals(TimeValue.timeValueMillis(300).nanos(), log.getQueryInfoThreshold()); @@ -355,7 +355,7 @@ public void testSetQueryLevels() { assertEquals(TimeValue.MINUS_ONE.nanos(), log.getQueryWarnThreshold()); settings = new IndexSettings(metadata, Settings.EMPTY); - log = new SearchSlowLog(settings, mock(SlowLogFields.class)); + log = new SearchSlowLog(settings, mock(ActionLogFields.class)); assertEquals(TimeValue.MINUS_ONE.nanos(), log.getQueryTraceThreshold()); assertEquals(TimeValue.MINUS_ONE.nanos(), log.getQueryDebugThreshold()); @@ -430,7 +430,7 @@ public void testSetFetchLevels() { .build() ); IndexSettings settings = new IndexSettings(metadata, Settings.EMPTY); - SearchSlowLog log = new SearchSlowLog(settings, mock(SlowLogFields.class)); + SearchSlowLog log = new SearchSlowLog(settings, mock(ActionLogFields.class)); assertEquals(TimeValue.timeValueMillis(100).nanos(), log.getFetchTraceThreshold()); assertEquals(TimeValue.timeValueMillis(200).nanos(), log.getFetchDebugThreshold()); assertEquals(TimeValue.timeValueMillis(300).nanos(), log.getFetchInfoThreshold()); @@ -461,7 +461,7 @@ public void testSetFetchLevels() { assertEquals(TimeValue.MINUS_ONE.nanos(), log.getFetchWarnThreshold()); settings = new IndexSettings(metadata, Settings.EMPTY); - log = new SearchSlowLog(settings, mock(SlowLogFields.class)); + log = new SearchSlowLog(settings, mock(ActionLogFields.class)); assertEquals(TimeValue.MINUS_ONE.nanos(), log.getFetchTraceThreshold()); assertEquals(TimeValue.MINUS_ONE.nanos(), log.getFetchDebugThreshold()); diff --git a/server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java b/server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java index e9a4912e770ff..ce9d5769a806f 100644 --- a/server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java +++ b/server/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java @@ -41,14 +41,14 @@ import org.elasticsearch.gateway.LocalAllocateDangledIndices; import org.elasticsearch.gateway.MetaStateWriterUtils; import org.elasticsearch.health.node.selection.HealthNodeTaskExecutor; +import org.elasticsearch.index.ActionLogFieldProvider; +import org.elasticsearch.index.ActionLogFields; import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.IndexVersion; import org.elasticsearch.index.IndexVersions; -import org.elasticsearch.index.SlowLogFieldProvider; -import org.elasticsearch.index.SlowLogFields; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.engine.EngineConfig; import org.elasticsearch.index.engine.EngineFactory; @@ -209,17 +209,17 @@ public void onIndexModule(IndexModule indexModule) { } } - public static class TestSlowLogFieldProvider implements SlowLogFieldProvider { + public static class TestActionLogFieldProvider implements ActionLogFieldProvider { private static Map fields = Map.of(); static void setFields(Map fields) { - TestSlowLogFieldProvider.fields = fields; + TestActionLogFieldProvider.fields = fields; } @Override - public SlowLogFields create() { - return new SlowLogFields() { + public ActionLogFields create() { + return new ActionLogFields() { @Override public Map indexFields() { return fields; @@ -233,23 +233,23 @@ public Map searchFields() { } @Override - public SlowLogFields create(IndexSettings indexSettings) { + public ActionLogFields create(IndexSettings indexSettings) { return create(); } } - public static class TestAnotherSlowLogFieldProvider implements SlowLogFieldProvider { + public static class TestAnotherActionLogFieldProvider implements ActionLogFieldProvider { private static Map fields = Map.of(); static void setFields(Map fields) { - TestAnotherSlowLogFieldProvider.fields = fields; + TestAnotherActionLogFieldProvider.fields = fields; } @Override - public SlowLogFields create() { - return new SlowLogFields() { + public ActionLogFields create() { + return new ActionLogFields() { @Override public Map indexFields() { return fields; @@ -263,7 +263,7 @@ public Map searchFields() { } @Override - public SlowLogFields create(IndexSettings indexSettings) { + public ActionLogFields create(IndexSettings indexSettings) { return create(); } } @@ -842,34 +842,34 @@ public void testBuildAliasFilterDataStreamAliases() { } public void testLoadSlowLogFieldProvider() { - TestSlowLogFieldProvider.setFields(Map.of("key1", "value1")); - TestAnotherSlowLogFieldProvider.setFields(Map.of("key2", "value2")); + TestActionLogFieldProvider.setFields(Map.of("key1", "value1")); + TestAnotherActionLogFieldProvider.setFields(Map.of("key2", "value2")); var indicesService = getIndicesService(); - SlowLogFieldProvider fieldProvider = indicesService.slowLogFieldProvider; - SlowLogFields fields = fieldProvider.create(null); + ActionLogFieldProvider fieldProvider = indicesService.actionLogFieldProvider; + ActionLogFields fields = fieldProvider.create(null); // The map of fields from the two providers are merged to a single map of fields assertEquals(Map.of("key1", "value1", "key2", "value2"), fields.searchFields()); assertEquals(Map.of("key1", "value1", "key2", "value2"), fields.indexFields()); - TestSlowLogFieldProvider.setFields(Map.of("key1", "value1")); - TestAnotherSlowLogFieldProvider.setFields(Map.of("key1", "value2")); + TestActionLogFieldProvider.setFields(Map.of("key1", "value1")); + TestAnotherActionLogFieldProvider.setFields(Map.of("key1", "value2")); // There is an overlap of field names, since this isn't deterministic and probably a // programming error (two providers provide the same field) throw an exception assertThrows(IllegalStateException.class, fields::searchFields); assertThrows(IllegalStateException.class, fields::indexFields); - TestSlowLogFieldProvider.setFields(Map.of("key1", "value1")); - TestAnotherSlowLogFieldProvider.setFields(Map.of()); + TestActionLogFieldProvider.setFields(Map.of("key1", "value1")); + TestAnotherActionLogFieldProvider.setFields(Map.of()); // One provider has no fields assertEquals(Map.of("key1", "value1"), fields.searchFields()); assertEquals(Map.of("key1", "value1"), fields.indexFields()); - TestSlowLogFieldProvider.setFields(Map.of()); - TestAnotherSlowLogFieldProvider.setFields(Map.of()); + TestActionLogFieldProvider.setFields(Map.of()); + TestAnotherActionLogFieldProvider.setFields(Map.of()); // Both providers have no fields assertEquals(Map.of(), fields.searchFields()); diff --git a/server/src/test/resources/META-INF/services/org.elasticsearch.index.SlowLogFieldProvider b/server/src/test/resources/META-INF/services/org.elasticsearch.index.ActionLogFieldProvider similarity index 75% rename from server/src/test/resources/META-INF/services/org.elasticsearch.index.SlowLogFieldProvider rename to server/src/test/resources/META-INF/services/org.elasticsearch.index.ActionLogFieldProvider index c536cf7bb2188..0545dc3b659ff 100644 --- a/server/src/test/resources/META-INF/services/org.elasticsearch.index.SlowLogFieldProvider +++ b/server/src/test/resources/META-INF/services/org.elasticsearch.index.ActionLogFieldProvider @@ -7,5 +7,5 @@ # License v3.0 only", or the "Server Side Public License, v 1". # -org.elasticsearch.indices.IndicesServiceTests$TestSlowLogFieldProvider -org.elasticsearch.indices.IndicesServiceTests$TestAnotherSlowLogFieldProvider +org.elasticsearch.indices.IndicesServiceTests$TestActionLogFieldProvider +org.elasticsearch.indices.IndicesServiceTests$TestAnotherActionLogFieldProvider diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlPlugin.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlPlugin.java index 85635a33c8fa1..1b90125b91a59 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlPlugin.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlPlugin.java @@ -207,7 +207,7 @@ public Collection createComponents(PluginServices services) { new IndexResolver(services.client()), services.telemetryProvider().getMeterRegistry(), getLicenseState(), - new EsqlQueryLog(services.clusterService().getClusterSettings(), services.slowLogFieldProvider()), + new EsqlQueryLog(services.clusterService().getClusterSettings(), services.actionLogFieldProvider()), extraCheckers ), new ExchangeService( diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/querylog/EsqlQueryLog.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/querylog/EsqlQueryLog.java index 567032285e752..82d43797b611f 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/querylog/EsqlQueryLog.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/querylog/EsqlQueryLog.java @@ -12,8 +12,8 @@ import org.elasticsearch.common.logging.ESLogMessage; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.index.SlowLogFieldProvider; -import org.elasticsearch.index.SlowLogFields; +import org.elasticsearch.index.ActionLogFieldProvider; +import org.elasticsearch.index.ActionLogFields; import org.elasticsearch.xcontent.json.JsonStringEncoder; import org.elasticsearch.xpack.esql.action.PlanningProfile; import org.elasticsearch.xpack.esql.session.Result; @@ -45,7 +45,7 @@ public final class EsqlQueryLog { public static final String LOGGER_NAME = "esql.querylog"; private static final Logger queryLogger = LogManager.getLogger(LOGGER_NAME); - private final SlowLogFields additionalFields; + private final ActionLogFields additionalFields; private volatile long queryWarnThreshold; private volatile long queryInfoThreshold; @@ -54,14 +54,14 @@ public final class EsqlQueryLog { private volatile boolean includeUser; - public EsqlQueryLog(ClusterSettings settings, SlowLogFieldProvider slowLogFieldProvider) { + public EsqlQueryLog(ClusterSettings settings, ActionLogFieldProvider actionLogFieldProvider) { settings.initializeAndWatch(ESQL_QUERYLOG_THRESHOLD_WARN_SETTING, this::setQueryWarnThreshold); settings.initializeAndWatch(ESQL_QUERYLOG_THRESHOLD_INFO_SETTING, this::setQueryInfoThreshold); settings.initializeAndWatch(ESQL_QUERYLOG_THRESHOLD_DEBUG_SETTING, this::setQueryDebugThreshold); settings.initializeAndWatch(ESQL_QUERYLOG_THRESHOLD_TRACE_SETTING, this::setQueryTraceThreshold); settings.initializeAndWatch(ESQL_QUERYLOG_INCLUDE_USER_SETTING, this::setIncludeUser); - this.additionalFields = slowLogFieldProvider.create(); + this.additionalFields = actionLogFieldProvider.create(); } public void onQueryPhase(Versioned esqlResult, String query) { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querylog/EsqlQueryLogTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querylog/EsqlQueryLogTests.java index 9598c5886d725..d6ef635845379 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querylog/EsqlQueryLogTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/querylog/EsqlQueryLogTests.java @@ -19,9 +19,9 @@ import org.elasticsearch.compute.operator.DriverCompletionInfo; import org.elasticsearch.core.Predicates; import org.elasticsearch.core.TimeValue; +import org.elasticsearch.index.ActionLogFieldProvider; +import org.elasticsearch.index.ActionLogFields; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.SlowLogFieldProvider; -import org.elasticsearch.index.SlowLogFields; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.esql.MockAppender; import org.elasticsearch.xpack.esql.action.EsqlExecutionInfo; @@ -139,16 +139,16 @@ public void testPrioritiesOnSuccess() { } - private SlowLogFieldProvider mockFieldProvider() { - return new SlowLogFieldProvider() { + private ActionLogFieldProvider mockFieldProvider() { + return new ActionLogFieldProvider() { @Override - public SlowLogFields create(IndexSettings indexSettings) { + public ActionLogFields create(IndexSettings indexSettings) { return create(); } @Override - public SlowLogFields create() { - return new SlowLogFields() { + public ActionLogFields create() { + return new ActionLogFields() { @Override public Map indexFields() { return Map.of(); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/telemetry/PlanExecutorMetricsTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/telemetry/PlanExecutorMetricsTests.java index 84bbd1f40f262..67277bb3730cf 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/telemetry/PlanExecutorMetricsTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/telemetry/PlanExecutorMetricsTests.java @@ -19,10 +19,10 @@ import org.elasticsearch.client.internal.Client; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.ActionLogFieldProvider; +import org.elasticsearch.index.ActionLogFields; import org.elasticsearch.index.IndexMode; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.SlowLogFieldProvider; -import org.elasticsearch.index.SlowLogFields; import org.elasticsearch.indices.IndicesExpressionGrouper; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.telemetry.metric.MeterRegistry; @@ -103,15 +103,15 @@ EsqlQueryLog mockQueryLog() { ) ) ); - return new EsqlQueryLog(clusterSettings, new SlowLogFieldProvider() { + return new EsqlQueryLog(clusterSettings, new ActionLogFieldProvider() { @Override - public SlowLogFields create(IndexSettings indexSettings) { + public ActionLogFields create(IndexSettings indexSettings) { return create(); } @Override - public SlowLogFields create() { - return new SlowLogFields() { + public ActionLogFields create() { + return new ActionLogFields() { @Override public Map indexFields() { return Map.of(); diff --git a/x-pack/plugin/security/src/main/java/module-info.java b/x-pack/plugin/security/src/main/java/module-info.java index 1fd6f007c86d3..09b9310eba1ad 100644 --- a/x-pack/plugin/security/src/main/java/module-info.java +++ b/x-pack/plugin/security/src/main/java/module-info.java @@ -5,7 +5,9 @@ * 2.0. */ +import org.elasticsearch.index.ActionLogFieldProvider; import org.elasticsearch.reservedstate.ReservedStateHandlerProvider; +import org.elasticsearch.xpack.security.logging.SecurityActionLogFieldProvider; module org.elasticsearch.security { requires java.naming; @@ -71,7 +73,7 @@ exports org.elasticsearch.xpack.security.authz to org.elasticsearch.internal.security; exports org.elasticsearch.xpack.security.authc to org.elasticsearch.xcontent, org.elasticsearch.internal.security; exports org.elasticsearch.xpack.security.authc.saml to org.elasticsearch.internal.security; - exports org.elasticsearch.xpack.security.slowlog to org.elasticsearch.server; + exports org.elasticsearch.xpack.security.logging to org.elasticsearch.server; exports org.elasticsearch.xpack.security.authc.support to org.elasticsearch.internal.security; exports org.elasticsearch.xpack.security.rest.action.apikey to org.elasticsearch.internal.security; exports org.elasticsearch.xpack.security.support to org.elasticsearch.internal.security; @@ -82,7 +84,7 @@ exports org.elasticsearch.xpack.security.audit to org.elasticsearch.internal.security; exports org.elasticsearch.xpack.security.metric to org.elasticsearch.internal.security; - provides org.elasticsearch.index.SlowLogFieldProvider with org.elasticsearch.xpack.security.slowlog.SecuritySlowLogFieldProvider; + provides ActionLogFieldProvider with SecurityActionLogFieldProvider; provides org.elasticsearch.cli.CliToolProvider with diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/slowlog/SecuritySlowLogFieldProvider.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/logging/SecurityActionLogFieldProvider.java similarity index 74% rename from x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/slowlog/SecuritySlowLogFieldProvider.java rename to x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/logging/SecurityActionLogFieldProvider.java index 1127f75370f4a..73c703b47185f 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/slowlog/SecuritySlowLogFieldProvider.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/logging/SecurityActionLogFieldProvider.java @@ -5,11 +5,11 @@ * 2.0. */ -package org.elasticsearch.xpack.security.slowlog; +package org.elasticsearch.xpack.security.logging; +import org.elasticsearch.index.ActionLogFieldProvider; +import org.elasticsearch.index.ActionLogFields; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.SlowLogFieldProvider; -import org.elasticsearch.index.SlowLogFields; import org.elasticsearch.xpack.security.Security; import java.util.Map; @@ -17,14 +17,14 @@ import static org.elasticsearch.index.IndexingSlowLog.INDEX_INDEXING_SLOWLOG_INCLUDE_USER_SETTING; import static org.elasticsearch.index.SearchSlowLog.INDEX_SEARCH_SLOWLOG_INCLUDE_USER_SETTING; -public class SecuritySlowLogFieldProvider implements SlowLogFieldProvider { +public class SecurityActionLogFieldProvider implements ActionLogFieldProvider { private final Security plugin; - private class SecuritySlowLogFields implements SlowLogFields { + private class SecurityActionLogFields implements ActionLogFields { private boolean includeUserInIndexing = false; private boolean includeUserInSearch = false; - SecuritySlowLogFields(IndexSettings indexSettings) { + SecurityActionLogFields(IndexSettings indexSettings) { indexSettings.getScopedSettings() .addSettingsUpdateConsumer(INDEX_SEARCH_SLOWLOG_INCLUDE_USER_SETTING, newValue -> this.includeUserInSearch = newValue); this.includeUserInSearch = indexSettings.getValue(INDEX_SEARCH_SLOWLOG_INCLUDE_USER_SETTING); @@ -33,7 +33,7 @@ private class SecuritySlowLogFields implements SlowLogFields { this.includeUserInIndexing = indexSettings.getValue(INDEX_INDEXING_SLOWLOG_INCLUDE_USER_SETTING); } - SecuritySlowLogFields() {} + SecurityActionLogFields() {} @Override public Map indexFields() { @@ -57,21 +57,21 @@ public Map queryFields() { } } - public SecuritySlowLogFieldProvider() { + public SecurityActionLogFieldProvider() { throw new IllegalStateException("Provider must be constructed using PluginsService"); } - public SecuritySlowLogFieldProvider(Security plugin) { + public SecurityActionLogFieldProvider(Security plugin) { this.plugin = plugin; } @Override - public SlowLogFields create(IndexSettings indexSettings) { - return new SecuritySlowLogFields(indexSettings); + public ActionLogFields create(IndexSettings indexSettings) { + return new SecurityActionLogFields(indexSettings); } @Override - public SlowLogFields create() { - return new SecuritySlowLogFields(); + public ActionLogFields create() { + return new SecurityActionLogFields(); } } diff --git a/x-pack/plugin/security/src/main/resources/META-INF/services/org.elasticsearch.index.SlowLogFieldProvider b/x-pack/plugin/security/src/main/resources/META-INF/services/org.elasticsearch.index.ActionLogFieldProvider similarity index 77% rename from x-pack/plugin/security/src/main/resources/META-INF/services/org.elasticsearch.index.SlowLogFieldProvider rename to x-pack/plugin/security/src/main/resources/META-INF/services/org.elasticsearch.index.ActionLogFieldProvider index 41f0ec83ac3f1..d1a6a2c705081 100644 --- a/x-pack/plugin/security/src/main/resources/META-INF/services/org.elasticsearch.index.SlowLogFieldProvider +++ b/x-pack/plugin/security/src/main/resources/META-INF/services/org.elasticsearch.index.ActionLogFieldProvider @@ -5,4 +5,4 @@ # 2.0. # -org.elasticsearch.xpack.security.slowlog.SecuritySlowLogFieldProvider +org.elasticsearch.xpack.security.logging.SecurityActionLogFieldProvider diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityTests.java index 917b30f7e3625..251254f516193 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/SecurityTests.java @@ -38,10 +38,10 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.env.TestEnvironment; import org.elasticsearch.features.FeatureService; +import org.elasticsearch.index.ActionLogFieldProvider; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.IndexVersions; -import org.elasticsearch.index.SlowLogFieldProvider; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.index.engine.InternalEngineFactory; import org.elasticsearch.index.engine.MergeMetrics; @@ -477,7 +477,7 @@ public void testOnIndexModuleIsNoOpWithSecurityDisabled() throws Exception { () -> true, TestIndexNameExpressionResolver.newInstance(threadPool.getThreadContext()), Collections.emptyMap(), - mock(SlowLogFieldProvider.class), + mock(ActionLogFieldProvider.class), MapperMetrics.NOOP, List.of(), new IndexingStatsSettings(ClusterSettings.createBuiltInClusterSettings()), diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java index 4ef1fdc276f9d..2c3fe5301567f 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginTests.java @@ -9,9 +9,9 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.TestEnvironment; +import org.elasticsearch.index.ActionLogFieldProvider; import org.elasticsearch.index.IndexModule; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.SlowLogFieldProvider; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.index.engine.InternalEngineFactory; import org.elasticsearch.index.engine.MergeMetrics; @@ -73,7 +73,7 @@ public void testWatcherDisabledTests() throws Exception { () -> true, TestIndexNameExpressionResolver.newInstance(), Collections.emptyMap(), - mock(SlowLogFieldProvider.class), + mock(ActionLogFieldProvider.class), MapperMetrics.NOOP, List.of(), new IndexingStatsSettings(ClusterSettings.createBuiltInClusterSettings()),