Skip to content
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

[jmxreceiver] add support for running custom Apache Groovy script at runtime #35933

Closed

Conversation

choucavalier
Copy link

Description

Target systems are predefined Groovy scripts that define JMX Mbeans metrics that should be collected. However, they are limited in the metrics they provide.

This patch allows using a custom Groovy script at runtime when running the jmxreceiver.

Testing

I've updated the tests to include this new config. Tests are passing locally.

Documentation

I've updated the README to reflect these changes.

@choucavalier choucavalier requested a review from a team as a code owner October 22, 2024 17:17
Copy link

linux-foundation-easycla bot commented Oct 22, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@atoulme
Copy link
Contributor

atoulme commented Oct 22, 2024

Please open an issue for discussion. The collector is trying to avoid allowing to run scripts that are too open ended and can be taken advantage of.

@breedx-splk
Copy link
Contributor

I would like to respectfully caution against this. Please see #34825 and be aware that the jmx-metrics-gatherer is being deprecated in favor of the new jmx-scraper which will drop groovy in favor of yaml.

We (java side of things) are not interested in maintaining groovy scripts going forward, and the ability to execute arbitrary groovy code has always been a security liability. The current plan is to remove the jmx-metrics module once jmx-scraper is deemed good enough for production.

@hughesjj
Copy link
Contributor

hughesjj commented Nov 6, 2024

For more background as to why arbitrary scripts aren't permitted as part of the -contrib collector's jmx recevier, please see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
receiver/jmx JMX Receiver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants