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

PropertyDescription
Command typeTransforming
Required permissionAdministrator
License usageN/A
Parallel executionSupported
Distributed executionNot supported

Syntax

sentry-jstack [timeout=INT]

Options

timeout=INT
RPC timeout in seconds. Accepts a value between 1 and 600. (Default: 30)

Input fields

FieldTypeRequiredDescription
guidstringRequiredSentry unique identifier.

Output fields

FieldTypeDescription
guidstringSentry unique identifier.
tidlongThread ID.
namestringThread name.
statestringThread state.
stacktracestringThread stack trace.
_errorstringError message if an error occurred.

Possible values for the state field:

ValueDescription
RUNNABLEA thread that can run at any time.
BLOCKEDA thread waiting for an object's lock to be released.
TIMED_WAITINGA thread waiting for a specified period of time.
WAITINGA thread waiting to synchronize with another thread.

Error codes

Parsing errors
Error codeMessageDescription
23100No permission to call sentry RPC.A user without administrator privileges ran the command.
23101Invalid 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 messageDescription
guid is nullThe guid field value in the input record is null.
guid should be stringThe guid field value in the input record is not a string.
guid should be non empty stringThe guid field value in the input record is an empty string.
not connectedThe sentry is not connected.
timeoutThe RPC request timed out.
disconnectedThe 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

  1. Retrieve a thread dump from all sentries

    system sentries | fields guid | sentry-jstack
    

    Retrieves a full thread dump from all connected sentries.

  2. Retrieve only BLOCKED threads

    system sentries | fields guid | sentry-jstack | search state == "BLOCKED"
    

    Filters only threads in the BLOCKED state from all sentries.