@mu-ts/xray
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

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)

/@mu-ts/xray/

    Package Sidebar

    Install

    npm i @mu-ts/xray

    Weekly Downloads

    15

    Version

    1.0.7

    License

    ISC

    Unpacked Size

    14.9 kB

    Total Files

    15

    Last publish

    Collaborators

    • matt-filion
    • strandedmusician
    • jeff-authvia