opentelemetry-java-contrib icon indicating copy to clipboard operation
opentelemetry-java-contrib copied to clipboard

JMX Metrics Gatherer should be able to specify both `jmx.target.system` and `jmx.groovy.script`

Open sirianni opened this issue 1 year ago • 2 comments

Component(s)

jmx-metrics

Is your feature request related to a problem? Please describe.

I'd like to collect both jvm metrics and custom application metrics with a single instance of JMX Metrics Gatherer.

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

This configuration yields an error

Exception in thread "main" io.opentelemetry.contrib.jmxmetrics.ConfigurationException: Only one of otel.jmx.groovy.script or otel.jmx.target.system can be specified.

Describe the solution you'd like

I'd like the ability to specify both options.

It looks like the code already supports multiple scripts so it should be a relatively simple change.

Describe alternatives you've considered

Running multiple JMX Gatherer instances. This requires more configuration and is an inefficient use of resources.

Additional context

No response

sirianni avatar Jun 27 '23 21:06 sirianni

cc: jmx-metrics component owners @breedx-splk @Mrod1598 @rmfitzpatrick @dehaansa

trask avatar Jun 27 '23 21:06 trask

Hello! Is this up for grabs?

BassemElMasry avatar Jan 12 '24 12:01 BassemElMasry

@BassemElMasry are you still working on this? If not, I believe I have a solution

jaydeluca avatar Jun 07 '24 09:06 jaydeluca