@@ -7,6 +7,41 @@ The JMX MBeans and their metric mappings are defined in YAML and reuse implement
77This is currently a work-in-progress component not ready to be used in production.
88The end goal is to provide an alternative to the [ JMX Gatherer] ( ../jmx-metrics/README.md ) utility.
99
10+ ## Usage
11+
12+ The general command to invoke JMX scraper is ` java -jar scraper.jar <config> ` , where ` scraper.jar `
13+ is the ` build/libs/opentelemetry-jmx-scraper-<version>.jar ` packaged binary when building this module.
14+
15+ Minimal configuration required
16+ - ` otel.jmx.service.url ` for example ` service:jmx:rmi:///jndi/rmi://server:9999/jmxrmi ` for ` server `
17+ host on port ` 9999 ` with RMI JMX connector.
18+ - ` otel.jmx.target.system ` or ` otel.jmx.custom.scraping.config `
19+
20+ Configuration can be provided through:
21+ - command line arguments: ` java -jar scraper.jar --config `
22+ - system properties ` java -jar scraper.jar `
23+ - java properties file: ` java -jar config.properties `
24+
25+ TODO: update this once autoconfiguration is supported
26+
27+ ### Configuration reference
28+
29+ TODO
30+
31+ ### Extra libraries in classpath
32+
33+ By default, only the RMI JMX connector is provided by the JVM, so it might be required to add extra
34+ libraries in the classpath when connecting to remote JVMs that are not directly accessible with RMI.
35+
36+ One known example of this is the Wildfly/Jboss HTTP management interface for which the ` jboss-client.jar `
37+ needs to be used to support ` otel.jmx.service.url ` = ` service:jmx:remote+http://server:9999 ` .
38+
39+ When doing so, the ` java -jar ` command can´t be used, we have to provide the classpath with
40+ ` -cp ` /` --class-path ` /` -classpath ` option and provide the main class file name:
41+ ```
42+ java -cp scraper.jar:jboss-client.jar io.opentelemetry.contrib.jmxscraper.JmxScraper <config>
43+ ```
44+
1045## Component owners
1146
1247- [ Jason Plumb] ( https://github.com/breedx-splk ) , Splunk
0 commit comments