open-telemetry / opentelemetry-java-contrib

https://opentelemetry.io
Apache License 2.0
144 stars 117 forks source link

Update JMX metrics to support both a script and target systems #1339

Closed jaydeluca closed 2 weeks ago

jaydeluca commented 3 weeks ago

Description:

The GroovyRunner supports loading multiple scripts, but currently only allows users to choose to run target systems or a custom script. This means that if someone wants to leverage both, they would need to run/manage multiple gatherer processes.

This change makes it so that users can specify target systems and custom groovy scripts in the same instance.

otel.jmx.service.url=service:jmx:rmi:///jndi/rmi://jetty:7203/jmxrmi
otel.jmx.target.system=jvm,hadoop
otel.jmx.groovy.script=/script.groovy

Existing Issue(s):

Resolves #937

Testing:

Test cases cover configuring target systems and scripts, as well as covering the case when otel.jmx.groovy.script might be a blank input string.

Documentation:

I updated readme, but feel free to point me to anywhere else that might need updating.