diff --git a/datadog.conf.example b/datadog.conf.example index 5e9f6fce76..fbe5f2210c 100644 --- a/datadog.conf.example +++ b/datadog.conf.example @@ -157,6 +157,10 @@ gce_updated_hostname: yes # Enable JMX checks for service discovery # sd_jmx_enable: no # +# If you require custom jars to be loaded for JMX checks, you can set their paths here +# instead of setting them in the checks' custom_jar_paths option +# jmx_custom_jars: /jmx-jars/jboss-cli-client.jar:/my/other/custom.jar +# # Docker labels as tags # We can extract docker labels and add them as tags to all metrics reported by service discovery. # All you have to do is supply a comma-separated list of label names to extract from containers when found. diff --git a/jmxfetch.py b/jmxfetch.py index 47c0d11d1d..7aab863100 100644 --- a/jmxfetch.py +++ b/jmxfetch.py @@ -87,6 +87,7 @@ def __init__(self, confd_path, agent_config): self.agent_config = agent_config self.check_frequency = DEFAULT_CHECK_FREQUENCY self.service_discovery = _is_affirmative(self.agent_config.get('sd_jmx_enable', False)) + self.config_jar_path = self.agent_config.get('jmx_custom_jars', "") self.jmx_process = None self.jmx_checks = None @@ -242,6 +243,8 @@ def _start(self, path_to_java, java_run_opts, jmx_checks, command, reporter, too classpath = r"%s:%s" % (tools_jar_path, classpath) if custom_jar_paths: classpath = r"%s:%s" % (':'.join(custom_jar_paths), classpath) + if self.config_jar_path: + classpath = r"%s:%s" % (self.config_jar_path, classpath) subprocess_args = [ path_to_java, # Path to the java bin