Skip to content

Expose ruby_plugin on filter/output delegators#18936

Open
kaisecheng wants to merge 1 commit intoelastic:mainfrom
kaisecheng:expose-ruby-plugin
Open

Expose ruby_plugin on filter/output delegators#18936
kaisecheng wants to merge 1 commit intoelastic:mainfrom
kaisecheng:expose-ruby-plugin

Conversation

@kaisecheng
Copy link
Copy Markdown
Contributor

What does this PR do?

Add a ruby_plugin JRuby method to all filter and output delegator types so that callers can access the underlying Ruby plugin instance when inspecting plugin config or instance variables.

Ruby-backed delegators (FilterDelegatorExt, OutputDelegatorExt, OutputStrategyExt) return the inner plugin object. Java-native delegators (JavaFilterDelegatorExt, JavaOutputDelegatorExt) return nil because they use the Java config system rather than LogStash::Config::Mixin.

Why is it important/What is the impact to the user?

Filters and outputs are wrapped in Java delegators whose ancestor chain is the Java class hierarchy. Code that needs to inspect plugin config (e.g. reading SSL certificate paths for hot-reload) must unwrap the delegator first to access get_config and instance variables. This PR provides a standard unwrapping method across all delegator types.

Checklist

  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files

How to test this PR locally

./gradlew :logstash-core:rubyTests --tests "org.logstash.config.ir.compiler.OutputDelegatorTest" --rerun-tasks

Related issues

  • Part of TLS hot-reload feature

Add a ruby_plugin JRuby method to all filter and output delegator types
so that callers can access the underlying Ruby plugin instance when
inspecting plugin config or instance variables.

Ruby-backed delegators (FilterDelegatorExt, OutputDelegatorExt,
OutputStrategyExt) return the inner plugin object. Java-native delegators
(JavaFilterDelegatorExt, JavaOutputDelegatorExt) return nil because they
use the Java config system rather than LogStash::Config::Mixin.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • run exhaustive tests : Run the exhaustive tests Buildkite pipeline.

@kaisecheng kaisecheng linked an issue Apr 2, 2026 that may be closed by this pull request
@kaisecheng kaisecheng marked this pull request as ready for review April 2, 2026 23:36
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 2, 2026

This pull request does not have a backport label. Could you fix it @kaisecheng? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

@elasticmachine
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose ruby plugin on filter output delegators

2 participants