System requirements for Java monitoring
Instana supports all Java runtimes from version 7 to 25. Use the most recent Java virtual machine (JVM) versions for bug-free runtimes. See the following sections for other requirements for monitoring JVM.
Supported JVM distributions
Instana supports the following JVM distributions:
- Amazon Corretto
- Azul Zulu
- IBM J9 (For more information, see IBM J9 and OpenJ9 considerations and IBM J9 and OpenJ9 limitations)
- Eclipse OpenJ9 (For more information, see IBM J9 and OpenJ9 considerations)
- OpenJDK
- AdoptOpenJDK
- Oracle HotSpot
- SAP JVM
- Sun HotSpot
- BEA JRockit
- Hitachi JVM
IBM J9 and OpenJ9 considerations
The Instana agent connects to IBM J9 and Eclipse OpenJ9 Java virtual machines through the Attach API. The default path for attach API-related files can be changed on J9 workloads by using the -Dcom.ibm.tools.attach.directory=<directory_name> Java system property. Instana agent supports this relocated attach directory for Java monitoring and Java AutoTrace.
IBM J9 and OpenJ9 limitations
Instana supports IBM J9 subject to the following limitations:
-
JVMs earlier than OpenJ9 v0.37.0, IBM SDK 8.0.8.5, or IBM Semeru 8.0.372.0 are not supported.
-
If
-javaagentis not set as a command-line argument, certain versions of IBM J9 might not support all the required features. Therefore, start the JVM with Java agent by running the following command:java -javaagent:instana-javaagent-1.0.0.jar -jar app.jar serverYou can download the JAR file from Artifact public. To log in to the page, use the following credentials:
- Username:
_ - Password:
<your-download-key>
If you are using Java 8 - Service refresh 3 fix pack 22 (Dec 2016), use the
-XX:+EnableHCRoption to perform the same operation. By using this temporary option, late-attached agents can redefine or retransform classes. In addition, if the following log line is present in the agent logs, pass the-XX:+EnableHCRoption as a startup parameter.WARN | instana-http-client-thread-16-2 | LoggerEndpoint | com.instana.agent - 1.1.680 | JVM (1234) - JVM does not support retransformation, tracing is currently unsupportedHowever, the
-XX:+EnableHCRoption might incur a performance penalty and might be removed in a future update when no longer necessary. - Username:
-
Extra command-line switches might be required to enable tracing and metrics collection from IBM J9:
-
Use
-Dcom.ibm.tools.attach.enable=yesas the default setting. -
For IBM J9 SDK 6 or IBM J9 SDK 7, complete the following steps:
- Disable class sharing by using the setting
-Xshareclasses:none. - Enable an implementation of class sharing that supports bytecode instrumentation (BCI) by using the setting
-Xshareclasses:enableBCI.
Note: Notes: IBM J9 SDK configuration defaults have the following differences: Version 6 (JRE 1.6.0) and version 7 (JRE 1.7.0) default to an implementation of class sharing that doesn't support BCI. Thus, class sharing must be turned off or BCI support must be turned on. Version 8 (JRE 1.8.0) defaults to an implementation of class sharing that supports BCI. - Disable class sharing by using the setting
-
Considerations for Java Runtimes 8 or earlier versions
If you are using Java Runtimes 8 or earlier versions, ensure that you complete the following actions:
-
On Amazon Corretto, Azul Zulu, OpenJDK, Oracle HotSpot, or SAP JVM, make the
tools.jarfile available in the runtime of each monitored JVM. The file is at$JAVA_HOME/lib/tools.jar. -
If you use Java 8, upgrade to Java 8 1.8.0_181 or later versions. The Java 8 builds up to 1.8.0_40 have many known issues that are related to the implementation of the lambda function. So for Java 8, the Instana agent does not support 1.8.0_40 or earlier versions. Therefore, you must upgrade to later versions because some crashes are fixed in them.
Considerations for Java Runtimes 9 or later versions
Java 9 introduces modularized builds based on the Jigsaw framework. If you are using Java Runtimes 9 or later versions, complete the following actions:
-
If you use a custom runtime image, such as the ones created with
jmodorjlink, make sure that you include the following modules in the instrumented JVM:-
java.instrument -
jdk.attach
To check whether your Java 9 or later runtime contains the required
java.instrumentandjdk.attachmodules, run the following command:java --list-modulesIf you run the command on a JVM 8 or earlier, the
Unrecognized option: --list-moduleserror message is displayed. -
-
If Apache Tomcat is running on Windows as a service, then the monitored processes do not run as the
C:\java12\bin\java.exefile but as theC:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\Tomcat8.exefile.Instana supports this setup. But before you start the service, the
bindirectory on the JVM running the service must be on thePATH. To set the path, run the following command:set PATH=%PATH%;C:\java12\binThe path must be set because the server
jvm.dllfile needs to load theC:\java12\bin\instrument.dllfile. If the file is not specified on the path, the server cannot find it, and the following error is displayed:com.sun.tools.attach.AgentLoadException: Failed to load agent library: instrument was not loaded.Can't find dependent libraries
Considerations for Java Runtime 21
If you are using Java Runtime 21, you might encounter the following warning messages:
WARNING: A Java agent has been loaded dynamically (/tmp/.instana/javaagent-loader-1.3.56.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release
To prevent this problem, add the following command in virtual machine arguments before you start your application:
-XX:+EnableDynamicAgentLoading
$TMP directory permission requirements
The Instana host agent creates temporary JAR files in the $TMP/.instana directory. These JAR files are required for the JVM monitoring. For successful JVM monitoring, ensure that the root user that runs the agent and the user that runs the JVM have the necessary read and write permissions for the $TMP directory. Also, do not clean up the Instana files from the $TMP and $TMP/.instana directories.
Span rate limiting
If you see logs, such as Suppressed spans due to high number of short or Discarded span due to queue overflow, in the agent log, it means that the Java Tracer experienced heavy load on span processing. As a result, the Java Tracer drops a few spans to avoid performance issues in the application.
To reduce the load, the Java Tracer performs the following steps:
- It suppresses the exit spans that have a short duration.
- If the load is still high, it groups spans in batches.
- If batching is not successful, it drops a few spans.