# What is Unique Token in Process?
A Unique Token is a distinct string used to identify the target application process for which diagnostics need to be captured. The yc-360 script supports process identification for Java, .NET, and Node.js applications.
# Why Use a Unique Token Instead of a Process ID?
In many environments-especially in containers and orchestration platforms like Kubernetes-process IDs (PIDs) are ephemeral and can change frequently due to restarts or scaling events.
Using a Unique Token offers a more stable and consistent way to locate the target process based on a known identifier (e.g., jar name, class name, startup argument, executable name, or Node.js entry script), rather than relying on dynamic PIDs.
This simplifies automation, avoids manual lookups, and ensures the yc-360 script always targets the correct process, even across deployments.
# Java Applications
# How the yc-360 Script Locates Your Java Process
When you pass a token using the -p argument, the yc-360 script:
- Runs
ps -ef | grep <TOKEN>inside the host or container. - Filters the result to extract the process ID of the matching process.
- Uses the PID of matching processes to capture diagnostics such as:
- Thread dumps
- Heap dumps
- GC logs
- System metrics like top, netstat, iostat, etc.
- Depending on the execution mode, either stores artifacts locally or transmits them to the yCrash server.
# Example
Suppose your application is launched with the following command:
java -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/tmp/my-gc.log -jar buggyApp.jar buggyapp
In this case, buggyapp is a unique argument in the command line. You can pass buggyapp as the token to identify the process:
./yc -p "buggyapp"
Important Note:
Ensure that the token is unique enough to identify only the intended process.
For Docker or Kubernetes, make sure the token appears in the process list within the container (you can check this using
docker execorkubectl execwithps -ef).
# What if the Token Matches Multiple Java Processes?
If the token you provide is not specific enough, the yc-360 script will match more than one process. In this case, diagnostics will be captured from all processes that contain the token in their command line.
Example: Generic Token (java)
Suppose you run the following processes on the same machine:
$ ps -ef | grep java
1001 2345 ... java -jar payment-service.jar
1002 2378 ... java -jar order-service.jar
1003 2399 ... java -jar buggyApp.jar buggyapp
2
3
4
./yc -p "java"
The script will capture thread dumps, heap dumps, GC logs, and system metrics for all three processes (payment-service, order-service, and buggyApp).
Best Practice:
Always use a token that uniquely identifies the intended process. This ensures the yc-360 script only targets the right process and avoids collecting artifacts from unrelated applications.
# .NET Applications
# How the yc-360 Script Locates Your .NET Process
When you pass a token using the -p argument, the yc-360 script:
- Runs
tasklist | findstr <TOKEN>on the Windows host. - Filters the result to extract the process ID of the matching application.
- Uses the PID of matching processes to capture diagnostics such as:
- Thread dumps
- Heap dumps
- GC logs
- System metrics
- Depending on the execution mode, either stores artifacts locally or transmits them to the yCrash server.
# Example
Suppose your application is launched and visible in the process list as:
tasklist | findstr PaymentService
PaymentService.exe 19468 Console 1 3,04,268 K
2
3
In this case, PaymentService is a unique string present in the executable name. You can pass PaymentService as the token to identify the process:
./yc -p "PaymentService"
Important Note:
Ensure that the token is unique enough to identify only the intended process.
Run
tasklist | findstr <TOKEN>manually first to verify that only the intended application appears in the output before passing it to the yc-360 script.
# What if the Token Matches Multiple .NET Processes?
If the token you provide is not specific enough, the yc-360 script will match more than one process. In this case, diagnostics will be captured from all processes that contain the token in their name.
Example: Generic Token (PaymentService)
Suppose the following processes are running on the same machine:
tasklist | findstr /I PaymentService
PaymentService.exe 19468 Console 1 304,268 K
PaymentServiceWorker.exe 20532 Console 1 98,120 K
PaymentServiceHelper.exe 22110 Console 1 45,332 K
2
3
4
5
6
./yc -p "PaymentService"
The script will capture diagnostics for all four matching processes (taskhostw, PaymentService, and tasklist).
Best Practice:
Always use a token that uniquely identifies the intended process. This ensures the yc-360 script only targets the right process and avoids collecting artifacts from unrelated applications.
# Node.js Applications
# How the yc-360 Script Locates Your Node.js Process
When you pass a token using the -p argument, the yc-360 script:
- Searches running processes for a command line that contains the token.
- On Linux / macOS, this is based on the process list (same idea as
ps -ef | grep <TOKEN>). - On Windows, it matches against each process's command line (not only the image name). That matters because many Node apps show up as
node.exe, so the script name or app path is what makes the match unique.
- On Linux / macOS, this is based on the process list (same idea as
- Filters the result to extract the process ID of each matching process.
- Uses the PID of matching processes to capture Node.js diagnostics such as:
- Process Overview
- GC log (when available)
- Event Loop Lag / Utilization
- Unhandled Rejections, Handle Growth, Module Inventory, and related Internals artifacts
- System metrics like top, netstat, iostat, etc.
- Depending on the execution mode, either stores artifacts locally or transmits them to the yCrash server.
NOTE: For Node.js captures, also pass
-appRuntime=nodejs(or setappRuntime: nodejsinyc-config.yaml) so yc-360 uses the Node.js capture path.
# Example
Suppose your application is launched with the following command:
node --trace-gc server.js
In this case, server.js is a unique part of the command line. You can pass server.js as the token to identify the process:
./yc -p "server.js" -appRuntime=nodejs
On Windows (PowerShell / Command Prompt), the same idea applies:
.\yc -p "server.js" -appRuntime=nodejs
Important Note:
Ensure that the token is unique enough to identify only the intended process. Prefer your entry script or app path (for example
server.jsorsrc\server.js) over a generic word likenode.Verify the match manually before capture:
Linux / macOS:
ps -ef | grep server.jsWindows:
Get-CimInstance Win32_Process -Filter "Name = 'node.exe'" | Select-Object ProcessId, CommandLineand confirm only the intended row contains your tokenFor Docker or Kubernetes, make sure the token appears in the process list inside the container (you can check this using
docker execorkubectl execwithps -ef).If you start the app with
npm run …on Windows, you may see twonode.exeprocesses (npm wrapper + your app). Choose a token that appears only in your app's command line (for exampleserver.js), notnpm-cli.js.
# What if the Token Matches Multiple Node.js Processes?
If the token you provide is not specific enough, the yc-360 script will match more than one process. In this case, diagnostics will be captured from all processes that contain the token in their command line.
Example: Generic Token (node)
Suppose you run the following processes on the same machine:
$ ps -ef | grep node
1001 18432 ... node server.js
1002 18510 ... node worker.js
1003 18610 ... node /usr/lib/node_modules/pm2/...
2
3
4
./yc -p "node" -appRuntime=nodejs
The script will attempt to capture diagnostics for every matching Node process (your app, workers, and tooling such as PM2), which is usually not what you want.
Best Practice:
Always use a token that uniquely identifies the intended process, typically the entry script name or a unique path segment. This ensures the yc-360 script only targets the right Node.js process and avoids collecting artifacts from unrelated node processes.
:::