sentry-jstack
Retrieves a full thread dump from a remote sentry. Use this command to remotely diagnose the internal operational state of a logger.
Command properties
| Property | Description |
|---|---|
| Command type | Transforming |
| Required permission | Administrator |
| License usage | N/A |
| Parallel execution | Supported |
| Distributed execution | Not supported |
Syntax
Options
timeout=INT- RPC timeout in seconds. Accepts a value between 1 and 600. (Default:
30)
Input fields
| Field | Type | Required | Description |
|---|---|---|---|
| guid | string | Required | Sentry unique identifier. |
Output fields
| Field | Type | Description |
|---|---|---|
| guid | string | Sentry unique identifier. |
| tid | long | Thread ID. |
| name | string | Thread name. |
| state | string | Thread state. |
| stacktrace | string | Thread stack trace. |
| _error | string | Error message if an error occurred. |
Possible values for the state field:
| Value | Description |
|---|---|
| RUNNABLE | A thread that can run at any time. |
| BLOCKED | A thread waiting for an object's lock to be released. |
| TIMED_WAITING | A thread waiting for a specified period of time. |
| WAITING | A thread waiting to synchronize with another thread. |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 23100 | No permission to call sentry RPC. | A user without administrator privileges ran the command. |
| 23101 | Invalid sentry RPC timeout option value. Use a value between 1 and 600. | The timeout option value is not a number or is outside the range 1–600. |
Runtime errors
Depending on the guid field value, the following error messages may be assigned to the _error field:
| Error message | Description |
|---|---|
| guid is null | The guid field value in the input record is null. |
| guid should be string | The guid field value in the input record is not a string. |
| guid should be non empty string | The guid field value in the input record is an empty string. |
| not connected | The sentry is not connected. |
| timeout | The RPC request timed out. |
| disconnected | The connection was lost while processing the RPC request. |
Other RPC exception messages may be assigned to the _error field depending on the state of the system where the sentry is installed.
Description
The sentry-jstack command sends asynchronous RPC messages requesting a full thread dump to remote sentries identified by the guid field of each input record. When a response is received from a sentry, the thread information is added to the input record and output.
The maximum length of the asynchronous RPC request queue is 100 by default and can be adjusted using the logpresso.core.sentry_rpc_parallel environment variable. When the queue is full and some sentries respond or time out, new RPC messages are sent to fill the freed slots.
Results are output in the order RPC responses are received, so the output record order may differ from the input record order.
To retrieve results from all Data Nodes at once in a cluster environment, use the sonar-sentry-jstack command.
Examples
-
Retrieve a thread dump from all sentries
system sentries | fields guid | sentry-jstackRetrieves a full thread dump from all connected sentries.
-
Retrieve only BLOCKED threads
system sentries | fields guid | sentry-jstack | search state == "BLOCKED"Filters only threads in the BLOCKED state from all sentries.