Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add jmx_custom_jars option to datadog.yaml #3648

Merged
merged 2 commits into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions datadog.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions jmxfetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down