DataDog and JMX: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 29: Line 29:
==Agent Classpath and Startup Options==
==Agent Classpath and Startup Options==


The agent must include the following classpath:
Working jmx.yaml configuration:


<pre>
<pre>
-Djava.class.path=${JAVA_HOME}/lib/jconsole.jar:${JAVA_HOME}/lib/tools.jar:${JBOSS_HOME}/bin/client/jboss-cli-client.jar
init_config:
</pre>
    custom_jar_paths:
      - /opt/jdg/bin/client/jboss-cli-client.jar


The agent must also receive the following system property on command line:
instances:
 
    - jmx_url: "service:jmx:remoting-jmx://1.2.3.4:4447"
<pre>
      user: jmx
-Dmodule.path=${JBOSS_HOME}/modules
      password: ***
      java_bin_path: /opt/jdk/bin/java
      name: jdg1
      tags:
        env: stage
        newTag: test
      conf:
        - include:
            domain: jboss.datagrid-infinispan
            bean:
              - type=Cache,name=gameStateCache(dist_sync),manager=clustered,component=Statistics
            attribute:
              attribute1:
                metric_type: counter
                alias: numberOfEntries
</pre>
</pre>


The full command line is:
<blockquote style="background-color: Gold; border: solid thin Goldenrod;">
 
:<br>Make sure the JMX user has been configured on target JBoss instances<br><br>
<pre>
</blockquote>
jconsole \
-J-Djava.class.path=${JAVA_HOME}/lib/jconsole.jar:${JAVA_HOME}/lib/tools.jar:${JBOSS_HOME}/bin/client/jboss-cli-client.jar \
-J-Dmodule.path=${JBOSS_HOME}/modules
</pre>


==Connect to the JBoss Instance==
==Connect to the JBoss Instance==

Revision as of 15:38, 19 October 2016

External

Internal

Configuration

The JMX configuration is located in /etc/dd-agent/conf.d/jmx.yaml.example.

After modification and removal of the ".example" suffix, restart datadog as root:

service datadog-agent restart

JMX integration with JBoss

Server Preparation

JBoss instances have to be configured to allow JMX agent access. Details on how to configure JBoss various JBoss versions running in various modes are available here:

WildFly and JMX

Agent Classpath and Startup Options

Working jmx.yaml configuration:

init_config:
    custom_jar_paths:
      - /opt/jdg/bin/client/jboss-cli-client.jar

instances:
    - jmx_url: "service:jmx:remoting-jmx://1.2.3.4:4447"
      user: jmx
      password: ***
      java_bin_path: /opt/jdk/bin/java
      name: jdg1
      tags:
        env: stage
        newTag: test
      conf:
        - include:
            domain: jboss.datagrid-infinispan
            bean:
              - type=Cache,name=gameStateCache(dist_sync),manager=clustered,component=Statistics
            attribute:
              attribute1:
                metric_type: counter
                alias: numberOfEntries

Make sure the JMX user has been configured on target JBoss instances

Connect to the JBoss Instance

Use the following URLs:

Troubleshooting

Agent Process Signature

ps -ef | grep java | grep datadog

dd-agent 14889 14841  0 Oct15 ? 00:05:47 \
  /opt/jdk/bin/java -Xms50m -Xmx200m \
  -classpath /opt/jdk/lib/tools.jar:/opt/datadog-agent/agent/checks/libs/jmxfetch-0.11.0-jar-with-dependencies.jar org.datadog.jmxfetch.App \
  --check jmx.yaml --check_period 15000 --conf_directory /etc/dd-agent/conf.d --log_level INFO \
  --log_location /var/log/datadog/jmxfetch.log --reporter statsd:localhost:8125 
  --status_location /opt/datadog-agent/run/jmx_status.yaml collect


Agent Reinitialization

service datadog-agent restart