• Home
  • Deploy Dynatrace
  • Dynatrace OneAgent
  • Installation and operation
  • Dynatrace for z/OS
  • z/OS installation overview
  • Install the z/OS Java code module

Install the z/OS Java code module

With the z/OS Java code module, you can get observability for your Java applications including IBM MQ and database calls.

Observability forIncluding

WebSphere Application Server

WebSphere Liberty

  • Incoming web requests on WebSphere Application Server and Liberty
  • Outgoing web requests from WebSphere Application Server and Liberty via the Apache HttpClient
  • Outgoing CICS Transaction Gateway requests from WebSphere Application Server and Liberty via the CTG client
  • Websphere Application Server Websphere Liberty specific metrics (PMI and JMX)
  • JVM specific managed memory metrics (JMX)

z/OS Connect

  • Incoming web requests on z/OS Connect
  • Outgoing requests from z/OS Connect via the CICS, IMS, and IBM MQ service providers
  • z/OS Connect specific metrics (JMX)
  • JVM specific managed memory metrics (JMX)

CICS/IMS transactions

Transactions initiated using

  • IBM MQ and JMS
  • CICS SOAP and CICS Transaction Gateway
  • IMS SOAP Gateway

Database calls

Database calls with their SQL statements from Java applications to DB2 via JDBC

Trace your Java applications end-to-end with Dynatrace and quickly detect any anomalies

Analyze the performance of your transactions end-to-end using the Service flow.

zOS Java 1

Use the PurePath distributed traces to drill down to the code level and to optimize your programs.

zOS Java 2

Quickly detect anomalies with the Service response time hotspots.

zOS Java 3

Analyze failures and exceptions with detailed stack traces.

zOS Java 4

Understand the health and performance of your JVM with the applications deployed on it

Gain insights into your JVM with the Dynatrace managed memory metrics:

zOS Java metrics 1

Understand the health and performance of your application servers with technology-specific metrics:

zOS Java metrics 2

What JMX and PMI metrics does Dynatrace provide out of the box?

JVM specific managed memory metrics:

Metric groupMetricSource

Java managed memory

Used memory

JMX

Java managed memory

Committed memory

JMX

Java managed memory

Maximum memory

JMX

Java managed memory

Garbage collection count

JMX

Java managed memory

Garbage collection time

JMX

WebSphere Liberty and z/OS Connect specific metrics:

Metric groupMetric nameMetric descriptionSource

JDBC connection pool

In use connections

The number of connections in use. This number might include multiple connections that are shared from a single managed connection.

JMX

JDBC connection pool

Free connections

The number of managed connections in the free pool.

JMX

JDBC connection pool

Managed connections

The total number of managed connections in the free, shared, and unshared pools.

JMX

JDBC connection pool

In use time

The average time in milliseconds that a connection is in use.

JMX

JDBC connection pool

Wait time

The average waiting time in milliseconds until a connection is granted if a connection is not currently available.

JMX

Thread pool

Pool size

The average number of threads in pool.

JMX

Thread pool

Active threads

The number of active threads that are serving requests.

JMX

Servlet

Request count

The total number of requests that a servlet processed.

JMX

Websphere Application Server specific metrics:

Metric groupMetric nameMetric descriptionSource

JDBC connection pool

Pool size

The size of the connection pool.

PMI

JDBC connection pool

Free pool size

The number of managed connections that are in the free pool.

PMI

JDBC connection pool

Concurrent waiters

The number of threads that are currently waiting for a connection.

PMI

JDBC connection pool

Average wait time

The average waiting time in milliseconds until a connection is granted if a connection is not currently available.

PMI

JDBC connection pool

Average use time

The average time in milliseconds that a connection is in use.

PMI

JDBC connection pool

Percent used

The percent of the pool that is in use.

PMI

Thread pool

Pool size

The average number of threads in pool.

PMI

Thread pool

Active threads

The number of concurrently active threads.

PMI

Servlet

Live sessions

The number of local sessions that are currently cached in memory from the time at which this metric is enabled.

PMI

Servlet

Total requests

The total number of requests that a servlet processed.

PMI

Can I monitor custom JMX metrics with the z/OS Java code module?

Yes, you can use the z/OS Java code module to monitor custom JMX metrics. For more information, see Monitor JMX metrics on z/OS.

Prerequisite

Activate the OneAgent feature Forward Tag 4 trace context extension.

Download

You can directly download the z/OS Java code module from your Dynatrace environment as described below:

  1. In the Dynatrace menu, select Deploy Dynatrace > OneAgent > Download OneAgent > z/OS.

  2. Download the JAR file (dynatrace-oneagent-zos-java.jar) and transfer it to your z/OS Unix System Services (USS) environment in binary mode.

  3. Create a new file with the name dtconfig.json in the z/OS USS folder where the code module is located.

    A minimal dtconfig.json file contains your Dynatrace environment ID (Tenant), cluster ID (ClusterID), and the zDC subsystem name (ZdcName). For example:

    json
    { "Tenant": "<tenant>", "ClusterID": <cluster>, "ZdcName": "DEFAULT" }

    Replace <tenant> and cluster with your Dynatrace environment values (see step 1 on where to get them).

    If the zDC name is defined as DEFAULT, the code module will connect to the default zDC subsystem ID. To use a different zDC, replace DEFAULT with an alternative subsystem ID.

    You can find the zDC subsystem name in the SYSIN parameters of your JCL SYSIN member ZDCSYSIN. The default zDC subsystem name is MEPC.

    plaintext
    //SYSIN DD DISP=SHR,DSN=<hlq>.SZDTSAMP(ZDCSYSIN) SUBSYSTEM_ID(MEPC) DEFAULT(YES)

    If DEFAULT is set to YES in the SYSIN parameters, you can also use DEFAULT in the dtconfig.json file.

Notes
  • EBCDIC 1047, UTF-8, and ASCII encodings are supported for the dtconfig.json file.
  • The code module automatically reads dtconfig.json when it's placed in the same folder as dynatrace-oneagent-zos-java.jar.
  • If you put dtconfig.json in a different folder, you need to specify the path to it via the environment variable DT_CONFIG_FILE. The path must include the filename. You can use an absolute path or a path relative to the working folder of the process.

Installation

Application server

You need to add the z/OS Java code module to the JVM arguments of each application server that you want to monitor.

  1. Open the WebSphere Application Server Admin Console and navigate to Application servers.

  2. Select <YOUR_SERVER> > Process definition > Servant, and choose Java Virtual Machine.

  3. Copy the JVM argument from your Dynatrace environment and paste it into the Generic JVM arguments:

    bash
    -javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar

    Replace PATH_TO with the path to your JAR file.

  4. Save the changes and restart your WebSphere Application Server.

Notes
  • It's only necessary to add the code module to the Servant processes.
  • We recommend adding the code module as the first JVM argument.
  • The code module must not be appended at the end of the command line.
  1. Create the jvm.options file in the root folder of your WebSphere Liberty (this folder typically also contains the server.xml file) or edit an existing file.

  2. Copy the JVM argument from your Dynatrace environment and paste it into the jvm.options file:

    console
    -javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar

    Replace PATH_TO with the path to your JAR file.

  3. Add the monitor-1.0 feature to your featureManager in the server.xml file to collect additional metrics like connection pools or thread pools:

    xml
    <server> <featureManager> <feature>monitor-1.0</feature> </featureManager> </server>
  4. Save the changes and restart your WebSphere Liberty.

Notes
  • We recommend to add the code module as the first JVM argument.
  • The code module must not be appended at the end of the command line.
  • We use the WebSphere Liberty server name as process group instance name per default. If you want to use a different process group instance name, you can override it by adding the following system property to your JVM command line: -Dwlp.server.name=yourServerName. Replace yourServerName with your individual name.
  1. Create the .jvmprofile file in your CICS region that belongs to the CICS JVMSERVER that is executing WebSphere Liberty or edit an existing file.

  2. Copy the JVM argument from your Dynatrace environment and paste it into the .jvmprofile file:

    bash
    -javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar

    Replace PATH_TO with the path to your JAR file.

  3. Add the monitor-1.0 feature to your featureManager in the server.xml file to collect additional metrics like connection pools or thread pools:

    xml
    <server> <featureManager> <feature>monitor-1.0</feature> </featureManager> </server>
  4. Save the changes and restart your WebSphere Liberty.

Notes
  • Monitoring of both the CICS region and the WebSphere Liberty that operates inside this CICS region is only supported if they report to a different zDC subsystem. If they report to different zDC subsystems, at least one of those zDCs must be started as non-default (see SUBSYSTEM_ID in the zDC SYSIN parameters). However, both zDCs can report to the same zRemote module.
    • For the CICS code module, the zDC subsystem name is defined in the CICS SYSIN parameters.
    • For the z/OS Java code module, the zDC subsystem name is defined in the dt.config.json file.
  • The WebSphere Liberty server name cannot be detected when it operates inside a CICS region. This will be addressed in the future.

Middleware

You need to add the z/OS Java code module to each product that you want to monitor.

  1. Add the code module to the JVM_OPTIONS STDENV variable:

    bash
    JVM_OPTIONS=-javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar

    Replace PATH_TO with the path to your JAR file.

  2. optional Add the monitor-1.0 feature to your featureManager in the server.xml file to collect additional metrics like connection pools or thread pools:

    xml
    <server> <featureManager> <feature>monitor-1.0</feature> </featureManager> </server>
  3. Save the changes and restart your z/OS Connect Enterprise Edition.

  4. For the CICS service provider, activate the OneAgent feature z/OS CICS z/OS Connect.

  5. z/OS Java code module version 1.235+ For the IMS service provider:

    1. Add the IMS code module to IMS Connect as described in Install the IMS code module.
    2. Activate the OneAgent feature z/OS IMS z/OS Connect.
  6. z/OS Java code module version 1.251+ For the MQ service provider, no additional configuration is needed.

  1. Add the code module to the CTGENV member and to the CTGSTART_OPTS variable:

    bash
    -j-javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar

    Replace PATH_TO with the path to your JAR file.

  2. Save the changes and restart your CICS Transaction Gateway.

Notes
  • Only the EXCI and IPIC protocols are supported.
  • WAS local mode configuration of the CICS Transaction Gateway configuration is not supported.
  1. Add the code module as a zDT option to the IMS SOAP Gateway parameters:

    bash
    zDT="-javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar"

    Replace PATH_TO with the path to your JAR file.

  2. Export the defined zDT option so that IBM_JAVA_OPTIONS includes it.

    bash
    export IBM_JAVA_OPTIONS="$zDT $JAVA_OPTS"
  3. Save your changes and restart the IMS SOAP Gateway.

JDBC database calls tracing

z/OS Java code module version 1.243+ Tracing of JDBC database calls requires an opt-in.

z/OS Java code module version 1.251+ Tracing of JDBC database calls is activated per default, no opt-in is required.

To opt-in for JDBC database calls tracing, add DisableJdbctransformer to your dtconfig.json file with the value false. For example

json
{ "DisableJdbctransformer": false }
Limitation

Only the DB2 JDBC driver types 2 and 4 are supported.

Logging

By default, logging is disabled for the z/OS Java code module. To enable logging, add one of the following options to the JVM argument:

OptionDefault valueDescription

log-stdout

false

If true, write logs to the standard output stream.

log-stderr

false

If true, write logs to the standard error stream.

log-file

false

If true, write logs to a file using file rotation (persisting the file with index 0). Naming scheme: dynatrace-oneagent-java.<PID>.<LPAR>.<INDEX>.log.

If needed, you can log to multiple locations. For example:

bash
-javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar=log-stdout=true,log-file=true

If needed, you can customize the file logging with the following options:

OptionDefault valueDescription

log-file-dir

<CODEMODULE_FOLDER>/logs

By default, write log files to the z/OS Java code module folder.

It's also possible to write the log files to an absolute path (schema: /<PATH_TO>/logs) or to a path relative to the working folder of the process (schema: <PATH_TO>/logs).

By changing the default folder, ensure that the application server has appropriate write permissions for the folder in which the code module should write the log files.

OneAgent diagnostics

Dynatrace recommends to write the logs to the shared log folder of the zDC so that they are included into the OneAgent diagnostics workflow. For example, if the dtzagent binary is located at /u/dt/agent/lib64/dtzagent in the z/OS USS environment, the log folder is /u/dt/log. Typically, a shared zDC log folder already exists and contains some zDC logs.

To enable file logging to an absolute path such as the shared zDC log folder /u/dt/log, specify the JVM argument as follows:

bash
-javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar=log-file=true,log-file-dir=/u/dt/log

If your zDC is installed in a different location, you must adopt the absolute path of the shared zDC log folder.

Update

To update your z/OS Java code module to a newer version

  1. Download the JAR file from your Dynatrace environment and transfer it to your z/OS USS environment in binary mode.
  2. Stop your monitored application server or middleware.
  3. Replace your current JAR file with the new JAR file.
  4. Start your application server or middleware.

Troubleshooting

JVM is executing in a program controlled environment

After starting the application server that you want to monitor, you might see Not Marked Program Controlled messages or errors with the return code 139:

plaintext
BPXP015I HFS PROGRAM /tmp/libdynatrace-oneagent-odin-java5848811742465559217.so IS NOT MARKED PROGRAM CONTROLLED.

This usually means that the z/OS Java code module must be program controlled.

To define the code module to be program controlled:

  1. Expand dynatrace-oneagent-zos-java.jar that you downloaded into a program controlled folder.

  2. Mark the appropriate .so file (31 or 64 bit) in the lib/zos-s390/ directory as program-controlled.

    Switch to the path that contains the .so files and issue the following command using the 31- or 64-bit file:

    console
    extattr +p libdynatrace-oneagent-odin-java_64.so
  3. Add zos-native-library-override to your JVM argument.

    plaintext
    -javaagent:/PATH_TO/dynatrace-oneagent-zos-java.jar=zos-native-library-override=<PATH_TO_SO>/<FILE>.so
    1. Replace <PATH_TO> with the path to your JAR file.
    2. Replace <PATH_TO_SO> with the absolute path to the .so file that you marked program controlled.
    3. Replace <FILE> with libdynatrace-oneagent-odin-java_64.
  4. Restart your application server.

Disable sensors of the z/OS Java code module

z/OS Java code module version 1.251+

All sensors of the z/OS Java code module are enabled per default. In case of problems, you can disable specific sensors via the dt.config.json file by setting their value to false. For example

json
{ "Sensors": { "Enable": { "CTG": { "Server": "false", "Client": "false" }, "HttpClient": { "Apache": "false" }, "JDBC": "false", "JMS": "false", "IbmMQ": "false", "Servlet": "false", "ZosConnect": "false" } } }