Skip to content

mu-ts/xray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Helpers for working with AWS XRAY

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published