# processTokens
Associates specific running Java processes with named applications. This helps the yc-360 script tag collected data and logs accurately per application when multiple Java processes are running on the same host.
Type: list[string]
Default: []
Example (YAML):
options:
processTokens:
- app-service.jar$App1
2
3
Example (CLI):
./yc -processTokens "app-service.jar$App1" -processTokens "analytics-service.jar$App2"
# How the processTokens Argument Works
On the host, multiple processes might be running. You might want yc-360 script to monitor only specific processes. To facilitate it, processTokens argument is used. Value of processTokens argument should be in this format <TOKEN_TO_IDENTIFY_PROCESS>$<APP_NAME>.
TOKEN_TO_IDENTIFY_PROCESS: A token that will uniquely identify the process. The yc-360 script will issue 'ps -ef | grep TOKEN_TO_IDENTIFY_PROCESS', whatever is the resulting process it will be monitored.
APP_NAME: In the yCrash dashboard, metrics that are captured for this identified process will be reported under this application name.
Suppose your host is running two Java processes:
$ ps -ef | grep java
ec2-user 8168 1 0 Sep09 ? 00:02:14 java -Xms2g -Xmx4g -DlogDir=. -DuploadDir=. -jar webapp-runner-9.0.52.1.jar -AconnectionTimeout=3600000 --port 8080 webBroker.war
ec2-user 12667 12628 31 01:16 pts/2 00:00:01 java -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/buggy-app.gc -jar buggyApp.jar bug2
2
3
You want the yc-360 script to monitor only the second process (with PID 12667). To do this:
- Choose a unique token from the command line of the second process. For example,
buggyApp.jar - Pair it with a user-friendly name to identify the application in the yCrash dasbhoard. For example,
myApp1
Your processTokens configuration in YAML should look like:
processTokens:
- buggyApp.jar$myApp1
2
When the yc-360 script runs, it will execute:
ps -ef | grep buggyApp.jar
It will then monitor the matching process and tag its metrics under the name myApp1 in the yCrash dashboard.
You can monitor multiple processes by adding additional entries:
processTokens:
- buggyApp.jar$myApp1
- webapp-runner$myApp2
2
3
Alternatively, you can pass processTokens via command-line arguments:
./yc -m3 -c yc-config.yaml -processTokens 'buggyApp.jar$myApp1' -processTokens 'webapp-runner$myApp2'
This gives you the flexibility to dynamically specify which processes to monitor without modifying the YAML file.