Randomly Expressed

About

Welcome to my blog “randomly expressed”. I created this website to publish helpful tips. It’s mainly technology driven, but I will blog about other topics. I am a Unix sysadmin that is always looking to learn new things. My goal is to be able to share knowledge that others may find useful. xkcd.com

Continue Reading »

Contact

Connect With US

Connect with us on the following social networking sites.

Most Popular Posts.

Add Some Content to This Area

You should either deactivate this panel on the Theme Settings page, or add some content via the Widgets page in your WordPress dashboard.

Data Dog JMX monitoring

By on February 20, 2017 in Technology with 2 Comments

Enabling Data Dog JMX monitoring will allow you to graph several metrics from your JVM applications. In this example I am going to enable JMX monitoring for Atlassian’s confluence server. There are two requirements to get the JMX plugin from data dog to work correctly.

  • Enable JMX on your JVM application.
  • Enable the JMX plugin from the data dog agent running your server.
  • In order to enable JMX on your JVM application you will need to add the following to your JAVA arguments and restart your JVM application. If you are using SSL then change it to true. For Atlassian’s Confluence server this will be located in your setenv.sh file.

    CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false ${CATALINA_OPTS}"

    Once you have restarted the Confluence application you should see the following listening on port 8086.

    root@confluence:~# lsof -i :8086
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    java 8360 confluence 21u IPv6 63122331 0t0 TCP *:8086 (LISTEN)

    Now you will need to enable Data Dog’s JMX plugin. This is assuming you have the data dog agent installed, if you don’t go ahead and install the agent now. To enable the JMX plugin create the following file named jmx.yaml under /etc/dd-agent/conf.d/jmx.yaml. It will contain the following:

    init_config:
    
    instances:
       - host: localhost
         port: 8086
    
    
         name: jmx_confluence  # optional
         java_bin_path: /opt/atlassian/confluence/jre/bin/java
         java_options: "-Xmx200m -Xms50m"
         trust_store_path: /path/to/trustStore.jks
    
         tools_jar_path: /usr/lib/jvm/java-8-oracle/lib/tools.jar
         refresh_beans: 600 # optional (in seconds)
         tags:
           env: dev
           newTag: jira-dev
    
         conf:
          - include:
              domain: my_domain
              bean:
                - my_bean
                - my_second_bean
              attribute:
                attribute1:
                  metric_type: counter
                  alias: jmx.my_metric_name
                attribute2:
                  metric_type: gauge
                  alias: jmx.my2ndattribute
          - include:
              domain: 2nd_domain
            exclude:
              bean:
                - excluded_bean
          - include:
              domain_regex: regex_on_domain
            exclude:
              bean_regex:
                - regex_on_excluded_bean
    

    Make sure you set the tools_jar_path to have the correct path to your tools.jar. The same goes for the java_bin_path. Once you have that set correctly, go ahead and restart your data dog agent.

    root@confluence:~# /etc/init.d/datadog-agent restart

    Restart the data dog agent by runnning the info command on the agent to verify the metrics for JMX are being collected.

    root@confluence:~# /etc/init.d/datadog-agent info

    You should see the following in your output after running the datadog-agent info command.

    jmx
    ---
    - instance #jmx_jira-dev [OK] collected 13 metrics
    - Collected 13 metrics, 0 events & 0 service checks

    Facebook Comments

    Tagged With: , , ,

    2 Reader Comments

    Trackback URL | Comments RSS Feed

    1. akash says:

      help me in setup facing few problems

    Post a Comment

    Your email address will not be published. Required fields are marked *

    Top