Skip to content

Improve plugin loading logging#28372

Open
wendigo wants to merge 4 commits intotrinodb:masterfrom
wendigo:user/serafin/plugin-loading-report
Open

Improve plugin loading logging#28372
wendigo wants to merge 4 commits intotrinodb:masterfrom
wendigo:user/serafin/plugin-loading-report

Conversation

@wendigo
Copy link
Contributor

@wendigo wendigo commented Feb 19, 2026

Description

Improves plugin loading by leaving only relevant information about plugin contents:

CleanShot 2026-02-19 at 17 11 54@2x

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Feb 19, 2026
@wendigo wendigo requested review from dain, electrum and martint and removed request for martint February 19, 2026 16:11
By enumerating features that were installed in the server once plugin was loaded
Verification already happens when all plugins are installed
@wendigo wendigo force-pushed the user/serafin/plugin-loading-report branch from ab8d171 to 0bde0f5 Compare February 19, 2026 16:27
Comment on lines +168 to +172
log.info("Loaded plugin %s (%s) with features:", COLORS.colored(features.pluginClass().getSimpleName(), PURPLE), features.loadingTime().convertToMostSuccinctTimeUnit());
for (Feature feature : Feature.values()) {
List<String> names = features.names(feature);
if (!names.isEmpty()) {
log.info(" %s: %s", feature.getDescription(), Joiner.on(", ").join(names));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those 2 logs should be single log call (one line)


for (ExchangeManagerFactory exchangeManagerFactory : plugin.getExchangeManagerFactories()) {
log.info("Registering exchange manager %s", exchangeManagerFactory.getName());
builder.withFeature(Feature.EXCHANGE_MANAGER, exchangeManagerFactory.getName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Feature enum is more FeatureType

also, maybe feature → component, extension, ... any other options concidered?

void loadPlugins();

void installPlugin(Plugin plugin);
InstalledFeatures installPlugin(Plugin plugin);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InstalledFeatures → PluginReflection, PluginInfo

it's not just "set of features" this plugin has, it includes other info like plugin main class (or installation time)

void installPlugin(Plugin plugin);
InstalledFeatures installPlugin(Plugin plugin);

record InstalledFeatures(Class<? extends Plugin> pluginClass, Duration loadingTime, List<InstalledFeature> features)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't make sense to provide loadingTime to the caller installPlugin(Plugin) caller, because caller also knows how long it took.
it caller cares about how long a call took, let it measure that

return new Builder(pluginClass);
}

public static class Builder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we need this builder for?
it looks the code would be equally readable without this class

FUNCTION("functions"),
GROUP_PROVIDER("group providers"),
HEADER_AUTHENTICATOR("header authenticators"),
LANGUAGE_FUNCTION("language functions engines"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FUNCTION_LANGUAGE?

bundle.getFunctions()
.stream()
.filter(function -> !function.isHidden())
.forEach(metadata -> builder.withFeature(Feature.FUNCTION, metadata.getCanonicalName()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to log every function name during startup?

@findepi
Copy link
Member

findepi commented Feb 25, 2026

Improves plugin loading by leaving only relevant information about plugin contents:

What was being informed about that is not longer there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants