TABLE OF CONTENTS
If present, the application name is automatically picked up from the
.jar file that launches, otherwise the command line is used in the same way Java tools display JVMs.
.jar file the two standard attributes in
Implementation-Title=Demo App Implementation-Version=1.0.0
Using build tools, both attributes can be set when building the application. For more information, see the Oracle documentation.
If no name is obtained using the procedure above, it's then determined by inspecting various system properties, for example
-Dcatalina.home for Tomcat containers.
To explicitly set the application name, when starting the JVM specify the
-Dcom.instana.agent.jvm.name="My Custom Name" attribute.
To have the agent use an already existing custom system property, specify a list of properties in the agent
configuration.yaml. First existing property will name the JVM:
com.instana.plugin.java: name-properties: - 'acme.app' - 'DEPLOYMENT'
To configure which JMX metrics to monitor, edit the agent
com.instana.plugin.java: jmx: # JMX is NOT hot-reloaded and needs to be set before a JVM is discovered. # Supported attribute types are Number and Boolean # delta calculation is only supported for Number - object_name: 'java.lang:type=Compilation' metrics: - attributes: 'TotalCompilationTime' type: 'delta' # delta will report the change to the previous second - object_name: 'java.lang:type=ClassLoading' metrics: - attributes: 'LoadedClassCount' type: 'absolute' # absolute will report the value as-is
Two types of metrics are specified in the example above:
deltais used for values that increase over time, such as counters, where the relative change is considered interesting.
absoluteis used to show the actual value each time the metric is accessed.
The attribute specified must either be a
Number (or one of its subclasses like
Double) or a
String representing a number.
On the JVM dashboard, the JMX metrics are displayed under Custom JMX metrics.
object_name may contain wildcard patterns as specified in Java's ObjectName API documentation. Here's an example of a configuration with wildcard patterns:
com.instana.plugin.java: jmx: - object_name: 'kafka.*:type=*-metrics,client-id=*,*' metrics: - attributes: 'incoming-byte-rate' type: 'absolute' - attributes: 'incoming-byte-total' type: 'absolute' - attributes: 'outgoing-byte-rate' type: 'absolute' - attributes: 'outgoing-byte-total' type: 'absolute'
This Instana package includes automatic instrumentation that is initialized on package load. This instrumentation provides distributed tracing information to your Instana dashboard.
To disable automatic instrumentation (tracing), edit the agent
com.instana.plugin.javatrace: instrumentation: # Lightweight Bytecode Instrumentation, enabled by default # Disabling currently requires an agent restart enabled: true