@mu-ts/xray
v1.0.7
Published
Helpers for working with AWS XRAY.
Downloads
5
Readme
xray
Syntactical sugar for working with XRAY.
Usage
XRAY.capture.*
For the most part, at the beginning of your handler you just need to tell XRAY what sources to capture from.
/**
* Registers all AWS services, with XRAY, that get used within the scope of the handler.
* Registers all HTTPS invocations with XRAY, that occur within the scope of the handler.
*/
XRAY.capture
.aws(require('aws-sdk'))
.httpsGlobal(require('https'));
Available capture points.
- aws(awssdk: typeof AWS)
- awsClient(service: T)
- httpsGlobal(mod: T, downstreamXRayEnabled: boolean)
- https(mod: T, downstreamXRayEnabled: boolean)
- asyncFunc(name: string, fcn: (subsegment?: Subsegment) => T, parent?: Segment | Subsegment);
- callbackFunc<S extends any[], T>(name: string, fcn: (...args: S) => T, parent?: Segment | Subsegment)
- func(name: string, fcn: (subsegment?: Subsegment) => T, parent?: Segment | Subsegment)