Batch application
The method is used to apply the WhaTap agent to back applications. Different from WAS, the batch application runs and stops repeatedly. Accordingly, it must be monitored differently.
Download agent
You can download the agent for batch application monitoring through the following command:
wget https://api.whatap.io/agent/whatap.agent.batch.tar.gz
Batch agent file configuration
whatap.agent.batch.tar.gz
⎿ whatap.agent-x.y.z.jar: Java agent
⎿ whatap.agent.batch.host-x.y.z.jar: Batch host - Transmits data to the collection server.
⎿ whatap.conf: Batch host configuration file (If there is no file, create a new one to add the items for license
and whatap.server.host
in Setting > Agent installation.)
⎿ agent/whatap.agent.batch-x.y.z.jar: Batch agent - Transmits the collected application data to the batch host.
⎿ agent/whatap.conf: Batch agent configuration file
Configuring the agent
Configuration of the batch host
For the values of the license
and whatap.server.host
options, see Setting > Agent installation for the project.
# default setting
license=
whatap.server.host=
# Transmit by divided steps
split_trace_enabled=true
# Maximum step count to be displayed for a trace
trace_step_max_count=1024
Batch agent configuration
# default setting
net_udp_listen_ip=0.0.0.0
net_udp_listen_port=6611
# Establishing communication with the bach host
net_udp_listen_ip=0.0.0.0
net_udp_listen_port=6611
# Maximum HTTP call count for a batch job
trace_httpc_limit=1000000
# Maximum SQL count for a batch job
trace_sql_limit=1000000
# Whether or not to display the active stack
active_stack_enabled=true
# Within 5 times
active_stack_time1=5000
# After 5 times
active_stack_time2=10000
# Initial stack start time
active_stack_start_wait_time=1000
Running the batch job
The batch job must be monitored from a single transaction perspective. WhaTap's Java agent needs to run two agents: Job agent for job processes and Host agent for relaying the information to the server.
Batch host commands
- Linux
- Windows
java -cp {BATCH_HOST_HOME}/whatap.agent.batch.host-x.y.z.jar:{BATCH_HOST_HOME}/whatap.agent-x.y.z.jar -Dwhatap.name=batch whatap.agent.batch.App
java --add-opens=java.base/java.lang=ALL-UNNAMED -cp {BATCH_HOST_HOME}/whatap.agent.batch.host-x.y.z.jar:{BATCH_HOST_HOME}/whatap.agent-x.y.z.jar -Dwhatap.name=batch whatap.agent.batch.App
java -cp {BATCH_HOST_HOME}/whatap.agent.batch.host-x.y.z.jar;{BATCH_HOST_HOME}/whatap.agent-x.y.z.jar -Dwhatap.name=batch whatap.agent.batch.App
java --add-opens=java.base/java.lang=ALL-UNNAMED -cp {BATCH_HOST_HOME}/whatap.agent.batch.host-x.y.z.jar;{BATCH_HOST_HOME}/whatap.agent-x.y.z.jar -Dwhatap.name=batch whatap.agent.batch.App
Batch agent commands
java -javaagent:{BATCH_AGENT_HOME}/whatap.agent.batch-x.y.z.jar -jar {APP_PATH}/batch-application.jar
java -javaagent:{BATCH_AGENT_HOME}/whatap.agent.batch-x.x.x.jar --add-opens=java.base/java.lang=ALL-UNNAMED -jar {APP_PATH}/batch-application.jar
Install and run the batch job agent and batch host agent together with the host that performs a batch job.
Setting the time limit
Between the batch job agent and batch host agent, communication is enabled through UDP.
Generally, a batch job is performed for a long time. It may take more than tens of seconds. Accordingly, the time_limit
values may differ depending on each batch job. Set the estimated process time for the batch job in time_limit
option.
time_limit=300000
warning_time=70% of time_limit
step_interval=5000
Setting the active equalizer's color
Set as follows to display in yellow if the batch job execution time exceeds 70% of time_limit
and display in red if it exceeds time_limit
.
## 70% of the estimated end time
yellow_time = time_limit * 0.7;
## upon exceeding the estimated end time
red_time = time_limit;
In order for the server administrator to check the delay of a batch job in real time, set the value of time_limit
properly.
Setting the active stack's collection interval
The batch job agent can collect active stacks at an interval set in the step_interval
option.
step_interval=5000
Collection of metrics for the batch agent
The dashboard collects the heap memory for the batch host and the performance metrics for batch applications are collected with the metric (TagCount: batch_job_counter
).
batch_job_counter
- batch job:
pid
,hostname
,job_name
- gc:
gc_count
,gc_time_sum
,gc_oldgen_count
- heap:
heap_tot
,heap_use
,heap_max
,heap_pending_final
,heap_perm
- cpu:
cputime
- thread count:
thread_total_started
,thread_count
,thread_daemon
,thread_peak_count
Next steps
-
Open source tracing
Depending on the framework or open source library used in applications, you may need to add agent options. For example, when using spring-boot-3.x, feign-client-11, or okhttp3-4.4 with a framework or open source, set the options as follows:
whatap.confweaving=spring-boot-3.0,feign-11,okhttp3-4.4
For information on how to configure the framework or open source library that suits your application environment, see the following.
-
Checking the installation
If you have created a project, installed an agent, and applied all JVM options, see the checklist in the following.
-
Installation troubleshooting
It provides various problems that may occur when installing the agent and specific instructions for resolving them. It provides solutions against various situations, including firewall configuration, SpringBoot and Tomcat JMX configuration, and server configuration using the OSGI framework. For more information, see the following.
-
Agent setting
It provides various features for monitoring by applying some options to the agent configuration file (whatap.conf). It includes basic configuration, configuration for server connection and data transfer, how to manage the configuration files for multiple application servers, and transaction tracing, and more. For more information, see the following.
-
Starting the monitoring
After all settings are made, restart the application server. The agent starts collecting data. First, check whether the monitoring data has been collected in Application Dashboard. For more information about Application Dashboard, see the following.