RpcTrace Class
Utility for tracing Rpc activity processing. When multiple Rpc requests are being processed asynchronously, this class can be used to correlate the current calltrace with the originating RpcActivity. This is used for automatic appending of RpcActivity to log messages emitted during Rpc processing. It may also be used to retrieve the user accessToken from the RpcActivity.
Methods
Name | Description | |
---|---|---|
constructor(): RpcTrace | ||
run<T>(activity: RpcActivity, fn: () => Promise<T>): Promise<T> Static | Start the processing of an RpcActivity. | |
runWithSpan<T>(activity: RpcActivity, fn: () => Promise<T>): Promise<T> Static | Start the processing of an RpcActivity inside an OpenTelemetry span |
Properties
Name | Type | Description | |
---|---|---|---|
currentActivity Accessor Static ReadOnly | undefined | RpcActivity | Get the RpcActivity for the currently executing async, or undefined if there is no |
|
expectCurrentActivity Accessor Static ReadOnly | RpcActivity | Get the RpcActivity for the currently executing async. |
Defined in
- core/backend/src/rpc/tracing.ts Line 26
Last Updated: 21 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.