Install APM Insight Java Agent in Glassfish 3.x & above


APM Insight Java Agent can be installed in Glassfish Server through Admin Console as follows:

Example: -javaagent:D:/apminsight/apminsight-javaagent.jar

Admin Console

  • Download latest the APM Insight java agent zip file (apminsight-javaagent.zip) here
  • For standalone setup:
    • Extract the zip file to a new directory outside the glassfish server directory
    • Open the apminsight.conf file in any text editor and include the following keys:
      license.key=[LICENSE KEY]
      apm.host=https://[HOST]:[PORT]/

      Example:

      license.key=APMI_74447444b666d7ab5174cc3021a9b68dd4b3364d50f99c2969360810313e8fac
      apm.host=https://app-w8-test:8443/
      To learn more about the configurations, visit our Configuration Guide page.
    • Open the administrative console of your glassfish server. Select Configurations and select the configuration used by the server
    • Select JVM Settings > Add JVM Option, then add the following parameter
      -javaagent:<agent_directory_full_path>/apminsight-javaagent.jar
    • Click Save button and start the glassfish server
  • For cluster setup:
    • Extract the zip file to a new directory outside the glassfish server directory
    • Copy the apminsight-javaagent.jar file from above directory to <GLASSFISH_HOME>\glassfish\domains\<domain>\lib\ext directory of the domain server
    • Create a new directory named "apminsight" under <GLASSFISH_HOME>\glassfish\nodes\<node>\<instance> in instance server and copy only the agent conf files from directory created in step 1 to this directory.
    • Open the apminsight.conf file in any text editor and include the following keys:
      license.key=[LICENSE KEY]
      apm.host=https://[HOST]:[PORT]/

      Example:

      license.key=APMI_74447444b666d7ab5174cc3021a9b68dd4b3364d50f99c2969360810313e8fac
      apm.host=https://app-w8-test:8443/
      To learn more about the configurations, visit our Configuration Guide page.
    • Repeat the above two steps for every instance you like to add the java agent
    • Open the administrative console of your glassfish server. Select Configurations and select the configuration used by the cluster.
    • Select JVM Settings > Add JVM Option, then add the following parameters as such
      -javaagent:${com.sun.aas.instanceRoot}/lib/ext/apminsight-javaagent.jar
      -Dapminsight.home=${com.sun.aas.instanceRoot}/apminsight
  • Click Save button and start the glassfish cluster.