# How to Configure Process Token?

The processTokens argument allows the yc-360 script (only in M3 mode) to monitor specific processes on a host. When multiple applications are running, each token uniquely identifies a process that yc-360 should track. The script uses each token to search running processes using ps -ef | grep <TOKEN>, and the metrics collected for that process are published in the yCrash dashboard under the specified application name. You can configure one or multiple process tokens either in the YAML configuration file or by passing them as command-line arguments.

# What is a Process Token?

A process token is a unique identifier used to select which process(es) the yc-360 script should monitor.

On any host, many processes may run simultaneously. If you want yc-360 to collect metrics only for specific processes, you must provide one or more processTokens.

Each entry in the processTokens array must follow this format:

TOKEN_TO_IDENTIFY_PROCESS$APP_NAME
1

Where:

  • TOKEN_TO_IDENTIFY_PROCESS: A distinctive string used to identify the process. yc-360 will execute
    ps -ef | grep TOKEN_TO_IDENTIFY_PROCESS. The matching process will be monitored.

  • APP_NAME: The name under which the metrics of the identified process will appear in the yCrash dashboard.

# Examples

# Identifying a Single Process

Consider a host 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
1
2
3

To monitor only the second Java process (PID: 12667), pass:

buggyApp.jar$myApp1
1

Here:

  • buggyApp.jar uniquely identifies the second Java process

  • myApp1 is the application name under which metrics will be reported

When the yc-360 script runs:

ps -ef | grep buggyApp.jar
1

it will match and monitor the second process.

# Corresponding YAML configuration:

processTokens:
  - buggyApp.jar$myApp1
1
2

# Monitoring Multiple Processes

If you want yc-360 to track both Java processes, specify multiple tokens:

processTokens:
  - buggyApp.jar$myApp1
  - webapp-runner$myApp2
1
2
3

Each entry identifies a different process and assigns a different application name.

# Passing processTokens via Command Line

Instead of defining tokens in the YAML file, you can also pass them directly to the yc-360 script:

./yc -m3 -c yc-config.yaml -processTokens 'buggyApp.jar$myApp1' -processTokens 'webapp-runner$myApp2'
1