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 StaticReadOnly undefined | RpcActivity Get the RpcActivity for the currently executing async, or undefined if there is no  
expectCurrentActivity Accessor StaticReadOnly RpcActivity Get the RpcActivity for the currently executing async.  

Defined in

Last Updated: 20 June, 2023