Skip to content

Plain Java Servlet Integration

Simone Zorzetti edited this page Mar 12, 2016 · 2 revisions

Note: since version 1.0.6

Declare a ServletContextListenerin the web.xml configuration file.

<webapp ...>
    <context-param>
        <param-name>jmxtrans.config</param-name>
        <param-value>
            classpath:jmxtrans.json
            classpath:org/jmxtrans/embedded/config/jmxtrans-internals.json
            classpath:org/jmxtrans/embedded/config/tomcat-7.json
            classpath:org/jmxtrans/embedded/config/jvm-sun-hotspot.json
        </param-value>
    </context-param>
    <listener>
        <listener-class>org.jmxtrans.embedded.servlet.EmbeddedJmxTransLoaderListener</listener-class>
    </listener>
</webapp>
  • jmxtrans.config: coma/line-break delimited list of jmxtrans configuration file urls (classpath:..., http://..., file:/...). Default value is classpath:jmxtrans.json, classpath:org/jmxtrans/embedded/config/jmxtrans-internals.json. Optional. You can use urls like etcd://host:port/path/key to retrieve a configuration json from an etcd kv store. If you have an etcd cluster use the syntax etcd://[host1:port1,host2:port2,...]/path/key . The members of the cluster are used only in failover mode and strictly in the sequence specified.