Skip to main content

Java Agent v2.1.0

2021-12-15

Modification of the agent management scheme

Agent version scheme modified

The agent version scheme has been changed to 2.1.x.

Modification of the configuration of the Java agent release package

From whatap.agent-2.1.0, the configuration of the Java agent package has been changed.

  • whatap.agent-2.1.0.jar: jar for the agent core
  • whatap.agent.proxy-2.1.0.jar: Direct connection to the WhaTap server is difficult, so bypass connection is supported.
  • whatap-logsink-lz4-1.7.0.jar: Plug module to compress data in the log monitoring (LogSink) (GZip provided in JDK is the default)

Expansion of Java support range

By using the ASM library v9.2, the support scope of WhaTap Labs Java agent has been expanded from java14 to java17.

Automation of multi-server tracing (mtrace)

The default policy for tracing the multi-server connection modified

The default value of agent-to-agent call performance tracing has been changed to on.

whatap.conf
tx_caller_meter_enabled = true
sql_dbc_meter_enabled = true
httpc_host_meter_enabled = true
actx_meter_enabled = true
actx_slice_meter_enabled = true

tx_caller_meter_pkind_enabled = true
actx_meter_pkind_enabled = true

Automatic application of the multi-server tracing

It changed to automatically process only the transactions called by the browser based on the user agent. (mtrace_rate works only when the user agent starts with "Moz.")

whatap.conf
mtrace_auto_enabled=true (default value)
mtraceable_user_agent=Moz (default value)

Automatic adjustment of the multi-server tracing rate

A function has been added to automatically lower the rate in an environment of 500 tps or higher if mtrace_rate has not been specified. Based on 500 tps in a single process, mtrace_rate is 10% by default. As tps increases, mtrace_rate is automatically adjusted at the same rate.

Changes in collection of dependencies between servers (agents)

It changed to collect caller data by OID when calls occur between agents belonging to different projects.

In the previous version, collection was made by PKIND (pcode + okind). It has been modified to collect by POID (pcode + oid).

Enhancement of tracing information

? and the rest in the DB connection URL have been removed.

When collecting the JDBC connection data to trace the SQL performance, ? and the rest have been removed.

ContextPath reflected in URL normalization

It changed to reflect ContextPath when performing URL normalization.

Change in URL patterns to set for the server

In WhaTap Labs, the patterns of the service or HttpClient URL have been changed to be set and collected by the WhaTap server.

URL pattern configuration targets

  • Service URL
  • HttpClient URL
Note

It is difficult to change in the Kubernetes environment with the agent setup method.

ONAME output in the agent log

It changed the agent log's output from the (date)(PID)(message) format to the (date)(agent name)(message) format.

20211224 05:12:31(GMT) [JA-161-111][UrlNorm] Service PathTree done. PathTree=0
20211224 05:12:31(GMT) [JA-161-111][HttpcUrlNorm] PathTree build done. PathTree=0

Adding the custom counter

It changed to use the plug-in to trace the app extra counter. However, the agent requires implementation of the plug-in, ExtraCounter.x.

  • ${WHATAP}/plugin/ExtraCounter.x
$pack.put("mycount",100);
$pack.put("myrandom",(float)( whatap.util.KeyGen.next()%100));

Application Log Monitoring

It has added the integrated monitoring function for application logs. Whatap.agent-2.1.0 or later is required to use this log monitoring function in Java applications.

Caution

whatap.agent-2.1.0 or later

The function name of WhaTap's application log monitoring is LogSink.

Enabling the log monitoring function

For log monitoring, in whatap.conf, set logsink_enabled to true.

whatap.conf
logsink_enabled=true

It collects System.out, System.err, and LOGBACK and LOG4J logs of the framework that occur in Java applications. The default value is the same setting as in logsink_enabled.

whatap.conf
logsink_stdout_enabled=logsink_enabled
logsink_stderr_enabled=logsink_enabled
logsink_logback_enabled=logsink_enabled
logsink_log4j_enabled=logsink_enabled
logsink_tomcat_enabled=logsink_enabled
logsink_custom_enabled=logsink_enabled

Collection of log details in the framework

To monitor logs collected from the framework, add the setting and plugin to intercept logs from the module. Set the default category name for logs collected in the framework to AppLog.

The default value is the same as in the hooklog_enabled option.

whatap.conf
hooklog_logback_enabled=hooklog_enabled;
hooklog_log4j_enabled=hooklog_enabled;
hooklog_tomcat_enabled=hooklog_enabled;
hooklog_custom_methods= (set to collect logs in the user method)

However, logsink_enabled is applied as the default value for hooklog_enabled, before startup, it needs to be set to true.

If you change as hooklog_enabled=true during operation, log collection is possible after restart.

Note

After changing as logsink_enabled=true, restart it.

Collection of logs in the user method

hooklog_custom_methods delivers the content of an arbitrary log framework. Use this to trace logs of the log module created on the website.

whatap.conf
hooklog_custom_methods=com.greatshop.common.Log.print

Setting to deliver logs

You can set the maximum size of a single line and the queue size during data transfer.

whatap.conf
logsink_queue_size=1000
logsink_line_size=512

Enabling or debugging the compressed log transfer

By the setting, logsink_zip_enabled=true, the compressed logs can be delivered.

whatap.conf
logsink_zip_enabled=false
debug_logsink_zip_enabled=false

All data is not compressed, and the debug options are used to check whether compressed logs are sent.

Minimum size of compressed logs transmission

If the data to send is less than 100 bytes, it is not compressed.

whatap.conf
logsink_zip_min_size=100

Size and time of the log's compressed transfer bundle

For compressed transfer, data must be bundled. However, because the next data cannot be waited indefinitely, the maximum time must be specified.

whatap.conf
max_buffer_size=65536
max_wait_time=2000

If the data collection size exceeds max_buffer_size or the log bundling time exceeds max_wait_time, the agent transfers the log data to the server.

Selecting the log compression algorithm

During compressed transfer for logs, its algorithm can be changed. The default algorithm is GZIP and lz4 can also be selected.

whatap.conf
logsink_zip_libpath=/whatap/whatap-logsink-lz4-1.7.0.jar
Note

For selecting an algorithm, specify a jar file in logsink_zip_libpath.

Fixing the bug where the agent does not work in the IBM Java6 Websphere environment

Fixed the bug where the Whatap agent could not initialize and collect data in the IBM Java6 Websphere environment.

Note

Due to an internal error of the ManagementFactory.getPlatformMBeanServer() logic, the WhaTap agent could not be initialized.

Adding the CounterPack debugging option

Added an option to debug whether the real-time performance data has been transferred from the agent.

whatap.conf
debug_counterpack_enabled=true (default value)
debug_counterpack_factor=3 (default value)
debug_counterpack_recvtime=9000 (default value)

If the number of standby CounterPacks in the agent queue increases to 3 or more, or the server's last transmission data speed exceeds 9000 ms, it is displayed as a log.

Added the compression option when collecting the Text & ActiveStack data.

Added an option to compress text data and ActiveStack data during collection.

whatap.conf
active_stack_zip_enabled=false (default value)
text_zip_enabled=false (default value)

Change of the system metrics collection library and fixing the memory data collection bug

Added OSHI

The OSHI (Operating System and Hardware Information) library collects the system infrastructure metrics and is frequently updated. Accordingly, it has been selected as a library for collecting the system performance metrics. However, it is available only in Java8 or later.

  • oshi_enabled=false (default value)
  • Available only in JDK8 or later
  • Can measure the usage and alert for disk="."

Deprecation for the Sigar function

It has not been updated for more than 5 years, so it was excluded from the initial settings.

  • sigar_enabled=false (default value)
  • Only aix included for lib1

To use the Sigar function, explicitly set as sigar_enabled=true.

Fixing the Linux memory collection bug

Fixed the collection bug for the memory usage and utilization in the Linux environment.

Setting the environment variables lookup as an option

An option has been added to turn on or off whether or not to perform the function when environment variables are viewed.

whatap.conf
agent_env_system_enabled=true
agent_env_jvm_enabled=true

You can control whether or not to view the process environment variables and Java environment variables as an option.

Option to exclude specific keys when viewing the agent environment variables

Added an option to exclude specific environment variables from the function to view the environment variables of the Java runtime environment.

whatap.conf
agent_env_ignore_keys=USER,Address

Options can be specified using comma (,) as the delimiter and they are not case sensitive.

Available in TOMCAT10

The scope of support has been expanded to trace the Tomcat10's jakarta library. You can specify tomcat10 as a weaving option for tracing.

whatap.conf
weaving=tomcat10
Note

The weaving option has been added in v2.1.1 as an abbreviation of the weaving_reserved option.

Tracing the HttpCall information details

Added the tracing data for HttpCall while tracing transactions.

Caution

In the collection server of an old version, the transaction step details cannot be checked.

If you have to send data to the collection server of an old version, add the trace_httpc_version option in whatap.conf.

whatap.conf
trace_httpc_version=1