When Elasticsearch starts up, plugins are loaded based on their inter-dependencies. The specific order used is sometimes useful to see. Currently though the actual order cannot be seen. Instead the modules and plugins are logged in name sorted order after all loading has occurred.

We should be more clear about what order the plugins are actually loaded in, though we do need to be careful as to not add too much noise. I suggest moving the "loaded xxx module" message to the actual loading method in PluginsService (it will require passing through whether the code being loaded is a module or plugin).


server/src/main/java/org/elasticsearch/plugins/PluginsService.java
for (final String name : pluginDescriptors.stream().map(PluginDescriptor::getName).sorted().toList()) {
                logger.info("loaded " + type + " [" + name + "]");
            }
        }
    }
    private static List<PluginRuntimeInfo> getRuntimeInfos(
        PluginIntrospector inspector,
        List<PluginDescriptor> pluginDescriptors,
        Map<String, LoadedPlugin> plugins
    ) {
        var officialPlugins = getOfficialPlugins();
        List<PluginRuntimeInfo> runtimeInfos = new ArrayList<>();
        for (PluginDescriptor descriptor : pluginDescriptors) {
            LoadedPlugin plugin = plugins.get(descriptor.getName());
            assert plugin != null;
            Class<?> pluginClazz = plugin.instance.getClass();
            boolean isOfficial = officialPlugins.contains(descriptor.getName());
            PluginApiInfo apiInfo = null;
            if (isOfficial == false) {
                apiInfo = new PluginApiInfo(inspector.interfaces(pluginClazz), inspector.overriddenMethods(pluginClazz));
            }
            runtimeInfos.add(new PluginRuntimeInfo(descriptor, isOfficial, apiInfo));
        }
        return runtimeInfos;
    }
    private static Set<String> getOfficialPlugins() {
        try (var stream = PluginsService.class.getResourceAsStream("/plugins.txt")) {
            return Streams.readAllLines(stream).stream().map(String::trim).collect(Sets.toUnmodifiableSortedSet());
        } catch (final IOException e) {
            throw new UncheckedIOException(e);