0.0.11 • Published 7 years ago
oly-node-sdk v0.0.11
Olympusat Node SDK
Reusable components for building Node applications in the Oly Cloud Platform
XRAY Tracing
Provides a simpler, unobtrusive interface for using XRAY to trace an application including decorators. All helpers return the values of the functions they call.
import XRAY from 'oly-node-sdk/build/src/xray'
XRAY.openTraceSegment(myFunction, label, options).then(...)- Required to call this at the head of your execution tree to open a context for tracing
- Opens a trace segment on
myFunctionwhich can have subsegments to granularly trace program execution labelrepresents the name/label of the trace in AWS XRAY dashboardoptionscan include HTTP request information, metadata and xray annotations. See typescript annotations for more details.- Returns the result of
myFunction()
- Synchronus Functions
XRAY.traceFunction(myFunction, label, options): Traces non-async function and returns the resultXRAY.decorateMethod(label, options): Can be used with typescript class method decorator syntax to decorate a method withXRAY.traceFunctionXRAY.decorateFunction(myFunction, label, options): Returns amyFunctiondecorated withXRAY.traceFunction, useful for reuse and calling with arguments.
- Asynchronus Functions
XRAY.traceAsyncFunction(myFunction, label, options): Traces async function and returns the result in a promiseXRAY.decorateAsyncMethod(label, options): Can be used with typescript class method decorator syntax to decorate an async method withXRAY.traceAsyncFunctionXRAY.decorateAsyncFunction(myFunction, label, options): Returns amyFunctiondecorated withXRAY.traceAsyncFunction, useful for reuse and calling with arguments.